This forum is no longer active. Please post your questions to our new community site

Installing python libraries

Subscribe to Installing python libraries 6 post(s), 2 voice(s)

 
Avatar genne 3 post(s)

Hi,

When I install new python libraries, such as python-libtorrent, using “sudo apt-get install python-libtorrent”, I can’t access it from within bitnami python. Though, if I use /usr/bin/python, I can access it, so the installation seems to be correct.

I guess I have to copy/move the libraries to the bitnami installation somehow, but I’m not sure how to do this correctly. I tried simply copying /usr/lib/pyshared/python2.6/libtorrent.so to /opt/bitnami/python/lib/python2.6/site-packages/, but I then get the following error when trying to import libtorrent in python:

ImportError: /usr/lib/libboost_python_py26.so.1.42.0: undefined symbol: PyUnicodeECS4_FromEncodedObject

Is there some recommended way to install new python libraries to bitnami using apt-get?

Thanks,
Christian

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

Try the following using the latest stable version of the code:

$ sudo apt-get install wget
$ wget http://download.deluge-torrent.org/source/delug…
$ tar -xzvf deluge-1.3.2.tar.gz
$ cd deluge-1.3.2
$ sudo python setup.py install

That’s all :) I hope it helps.

 
Avatar genne 3 post(s)

Hi,

Thanks for the reply, though it still doesn’t work for me :( Deluge didn’t seem to include libtorrent, so I tried building it using “python setup.py build” before installing. After successfully building libtorrent.so, I tried including it, but still got the same error “undefined symbol: PyUnicodeECS4_FromEncodedObject”.

Could it be that libboost_python is incorrectly built/configured?

Regards,
Christian

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

It is strange, could you check that the python binary that you are running is “/opt/bitnami/python/bin/python”? It should not depend on the /usr/lib/libboost_python_py26.so library.

 
Avatar genne 3 post(s)

Hi,

Yes, /opt/bitnami/python/bin/python is the one being used (found out by running “python —help”).

/ Christian

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Not sure but I try to find a possible solution and I found the following workaround:

http://wxpython-users.1045709.n5.nabble.com/Wei…

“Actually, I was able to fix this by setting UNICODE=1 in the config.py file… now things work as they should!”