ucs2 and ucs4 python

A

Alan Kesselmann

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
 
M

Miki Tebeka

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
 
Z

zayatzz

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

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
 
Z

zayatzz

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
 
Z

zayatzz

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

Thanks man!

And thanks again to everybody else :)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top