ucs2 and ucs4 python

Discussion in 'Python' started by Alan Kesselmann, May 15, 2012.

  1. Hello

    I tried using one compiled library and got this error:
    ImportError: /home/alan/Downloads/pdftron/PDFNetC64/Lib/
    _PDFNetPython2.so: undefined symbol: PyUnicodeUCS2_AsUTF8String

    I googled around and found some info about the meaning of the error.
    The creators of PDFNet suggested i install UCS2 python next to my UCS4
    version to try their library.

    Can someone point me towards a resource or two which will tell me how
    to do this - im not very good with whole linux/servers stuff. Im using
    ubuntu linux - if that makes any difference.

    Alan
     
    Alan Kesselmann, May 15, 2012
    #1
    1. Advertising

  2. Alan Kesselmann

    Miki Tebeka Guest

    > Can someone point me towards a resource or two which will tell me how
    > to do this - im not very good with whole linux/servers stuff. Im using
    > ubuntu linux - if that makes any difference.

    Did not test, but this is the direction I would take:
    * Download Python sources
    * Open Terminal
    * Run the following commands in the Terminal window
    - sudo apt-get build-dep python
    - tar -xjf Python-2.7.3.tar.bz2
    - cd Python-2.7.3
    - ./configure --prefix=/opt --enable-unicode=ucs2 && make
    - sudo make install
    * Now you should have /opt/bin/python with ucs2

    HTH
    --
    Miki Tebeka <>
    http://pythonwise.blogspot.com
     
    Miki Tebeka, May 15, 2012
    #2
    1. Advertising

  3. Alan Kesselmann

    zayatzz Guest

    On May 15, 7:42 pm, Miki Tebeka <> wrote:
    > > Can someone point me towards a resource or two which will tell me how
    > > to do this - im not very good with whole linux/servers stuff. Im using
    > > ubuntu linux - if that makes any difference.

    >
    > Did not test, but this is the direction I would take:
    > * Download Python sources
    > * Open Terminal
    > * Run the following commands in the Terminal window
    >   - sudo apt-get build-dep python
    >   - tar -xjf Python-2.7.3.tar.bz2
    >   - cd Python-2.7.3
    >   - ./configure --prefix=/opt --enable-unicode=ucs2 && make
    >   - sudo make install
    > * Now you should have /opt/bin/python with ucs2
    >
    > HTH
    > --
    > Miki Tebeka <>http://pythonwise.blogspot.com


    Thanks for reply :)

    And it seems to work... When i type in
    /opt/bin/python
    import sys
    sys.maxunicode

    then i get the desired answer - 65535

    But it seems the work only begins now, because i cant use other python
    libraries now with this version of python and i probably have to
    install them all again somehow...

    But thanks for your help :)

    Alan
     
    zayatzz, May 16, 2012
    #3
  4. Alan Kesselmann

    zayatzz Guest

    There is one problem though...

    when i start script with shebang like
    #!/opt/bin/python

    and then try to run the script i get:

    /opt/bin/python^M: bad interpreter: No such file or directory

    /opt/bin/python
    /opt/bin/python2
    /opt/bin/python2.7 all start this new version of python, but none of
    those work in shebang

    Alan
     
    zayatzz, May 16, 2012
    #4
  5. Alan Kesselmann

    Matej Cepl Guest

    On 16.5.2012 10:36, zayatzz wrote:
    > /opt/bin/python^M: bad interpreter: No such file or directory


    Your script has CRLF end-of-lines. Change it to plain Unix LF.

    Matěj
     
    Matej Cepl, May 16, 2012
    #5
  6. Alan Kesselmann

    zayatzz Guest

    On May 16, 11:50 am, Matej Cepl <> wrote:
    > On 16.5.2012 10:36, zayatzz wrote:
    >
    > > /opt/bin/python^M: bad interpreter: No such file or directory

    >
    > Your script has CRLF end-of-lines. Change it to plain Unix LF.
    >
    > Matěj


    Thanks :) but i have no idea what that means or how to achieve that.

    Alan
     
    zayatzz, May 16, 2012
    #6
  7. Alan Kesselmann

    zayatzz Guest

    No need to answer that now, Dave explained this to me via personal
    reply.

    Thanks man!

    And thanks again to everybody else :)
     
    zayatzz, May 16, 2012
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Dittmar

    How to dectect UCS4 Python at runtime?

    Daniel Dittmar, Aug 7, 2003, in forum: Python
    Replies:
    2
    Views:
    391
    Andreas Jung
    Aug 7, 2003
  2. Neal Becker

    ucs2 or ucs4?

    Neal Becker, Jan 14, 2008, in forum: Python
    Replies:
    1
    Views:
    339
    Paul Hankin
    Jan 14, 2008
  3. abhi

    Unicode problem in ucs4

    abhi, Mar 19, 2009, in forum: Python
    Replies:
    15
    Views:
    683
  4. James Mills

    GSM to ISO / UCS2 to ISO

    James Mills, Aug 16, 2010, in forum: Python
    Replies:
    0
    Views:
    496
    James Mills
    Aug 16, 2010
  5. Alexander Gattin

    Re: GSM to ISO / UCS2 to ISO

    Alexander Gattin, Aug 28, 2010, in forum: Python
    Replies:
    0
    Views:
    473
    Alexander Gattin
    Aug 28, 2010
Loading...

Share This Page