Page 1 of 2
deluged error "ImportError: No module named libtorrent"
Posted: Sat Sep 21, 2013 5:36 pm
by crishna
Dear community, I need help from the Experts around here, I exhausted all my local resources and being trying for days.
good side of this is I learned a lot, down side, still not working.
I am using Oracle Linux 6.4, so I had to download [deluged: 1.3.900-dev] from GIT (learned git and git clone and pull...)
followed by [libtorrent-rasterbar-0.16.11], git again
got [boost 1.41.0-17.el6_4] via yum
compiled libtorrent, then trying to get deluge starting, keep getting this
Code: Select all
[user@linux deluge]# 13:38:52.414 [ERROR ][deluge.main :1088] No module named libtorrent
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/deluge-1.3.900_dev-py2.6.egg/deluge/main.py", line 253, in run_daemon
Daemon(options, args)
File "/usr/lib/python2.6/site-packages/deluge-1.3.900_dev-py2.6.egg/deluge/core/daemon.py", line 125, in __init__
from deluge.core.core import Core
File "/usr/lib/python2.6/site-packages/deluge-1.3.900_dev-py2.6.egg/deluge/core/core.py", line 37, in <module>
from deluge._libtorrent import lt
File "/usr/lib/python2.6/site-packages/deluge-1.3.900_dev-py2.6.egg/deluge/_libtorrent.py", line 59, in <module>
import libtorrent as lt
ImportError: No module named libtorrent
here is the libtorrent compiled
Code: Select all
[root@linux lib]# ls -ltr
total 344540
-rwxr-xr-x 1 root root 91929405 Sep 21 12:44 libtorrent-rasterbar.so.7.0.0
lrwxrwxrwx 1 root root 29 Sep 21 12:44 libtorrent-rasterbar.so.7 -> libtorrent-rasterbar.so.7.0.0
lrwxrwxrwx 1 root root 29 Sep 21 12:44 libtorrent-rasterbar.so -> libtorrent-rasterbar.so.7.0.0
-rwxr-xr-x 1 root root 1078 Sep 21 12:44 libtorrent-rasterbar.la
-rw-r--r-- 1 root root 260864762 Sep 21 12:44 libtorrent-rasterbar.a
drwxr-xr-x 2 root root 4096 Sep 21 12:44 pkgconfig
[root@linux lib]# pwd
/usr/local/lib
I can't figure out what is not working...
Re: deluged error "ImportError: No module named libtorrent"
Posted: Sat Sep 21, 2013 6:38 pm
by Cas
You should not be using that git branch:
http://dev.deluge-torrent.org/wiki/GitR ... geBranches
Did you configure libtorrent with the python bindings?
Code: Select all
./configure --enable-python-binding
Re: deluged error "ImportError: No module named libtorrent"
Posted: Sat Sep 21, 2013 10:44 pm
by crishna
ok I will try to use a different branch, I guess si need to learn that as well!
for the ./configure, no I did not... i'll do it now!
Re: deluged error "ImportError: No module named libtorrent"
Posted: Sat Sep 21, 2013 10:50 pm
by crishna
python gives me an error...
Code: Select all
configure: error:
Could not link test program to Python. Maybe the main Python library has been
installed in some non-standard library path. If so, pass it to configure,
via the LDFLAGS environment variable.
Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
============================================================================
ERROR!
You probably have to install the development version of the Python package
for your distribution. The exact name of this package varies among them.
============================================================================
See `config.log' for more details
I have python 2.6...
the log file, grep python...
Code: Select all
configure:18561: gcc -o conftest -lpthread -g -O2 -fvisibility=hidden -I/usr/include -I/usr/include/python2.6 -L/usr/lib64 conftest.c -lrt -lpthread -L/usr/lib64 -lpython2.6 -Xlinker -export-dynamic -lpthread -ldl -lutil >&5
conftest.c:34:22: error: Python.h: No such file or directory
| #define HAVE_PYTHON "2.6"
| #include <Python.h>
Could not link test program to Python. Maybe the main Python library has been
Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
You probably have to install the development version of the Python package
I will first, get rid of this "branch" and I guess you would like me to get the stable one! so I will switch to that and post my results later
Re: deluged error "ImportError: No module named libtorrent"
Posted: Sat Sep 21, 2013 10:53 pm
by crishna
using this wiki page, I switched to stable, ill try again to compile stuff!
Re: deluged error "ImportError: No module named libtorrent"
Posted: Sat Sep 21, 2013 10:58 pm
by crishna
my new version is now
[deluged: 1.3.6-dev]
$ git status
# On branch 1.3-stable
nothing to commit (working directory clean)
I did, after getting the git branch changed
python setup.py clean -a
python setup.py build
python setup.py install
python setup.py install_data
then started deluge, same results
Code: Select all
$ [ERROR ] 19:04:48 main:237 No module named libtorrent
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/deluge-1.3.6_dev-py2.6.egg/deluge/main.py", line 230, in start_daemon
Daemon(options, args)
File "/usr/lib/python2.6/site-packages/deluge-1.3.6_dev-py2.6.egg/deluge/core/daemon.py", line 136, in __init__
from deluge.core.core import Core
File "/usr/lib/python2.6/site-packages/deluge-1.3.6_dev-py2.6.egg/deluge/core/core.py", line 36, in <module>
from deluge._libtorrent import lt
File "/usr/lib/python2.6/site-packages/deluge-1.3.6_dev-py2.6.egg/deluge/_libtorrent.py", line 59, in <module>
import libtorrent as lt
ImportError: No module named libtorrent
Re: deluged error "ImportError: No module named libtorrent"
Posted: Sat Sep 21, 2013 11:03 pm
by crishna
installing python-devel, as suggested by the output...
Re: deluged error "ImportError: No module named libtorrent"
Posted: Sat Sep 21, 2013 11:05 pm
by crishna
./configure --with-boost-libdir="/usr/lib64" --enable-python-binding
worked like a charm, proceeding with next steps.
posting my configure.conf
Code: Select all
$ cat config.report
Config results:
-=-=-=-=-=-=-=-=-
Package:
name: libtorrent-rasterbar
version: 0.16.11
svn revision: 8829
Build environment:
build system: x86_64-unknown-linux-gnu
host system: x86_64-unknown-linux-gnu
target system: x86_64-unknown-linux-gnu
Compiler and linker flags:
CPPFlags: -I/usr/include
CFlags: -lpthread -g -O2 -fvisibility=hidden
CXXFlags: -g -O2 -fvisibility-inlines-hidden
LDFlags: -L/usr/lib64
Libs: -lrt -lpthread
Defs: -DPACKAGE_NAME=\"libtorrent-rasterbar\" -DPACKAGE_TARNAME=\"libtorrent-rasterbar\" -DPACKAGE_VERSION=\"0.16.11\" -DPACKAGE_STRING=\"libtorrent-rasterbar\ 0.16.11\" -DPACKAGE_BUGREPORT=\"arvid@rasterbar.com\" -DPACKAGE_URL=\"http://www.libtorrent.org\" -DPACKAGE=\"libtorrent-rasterbar\" -DVERSION=\"0.16.11\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_PTHREAD=1 -DHAVE_BOOST=1 -DHAVE_BOOST_SYSTEM=1 -DHAVE_GETHOSTBYNAME=1 -DHAVE_GETHOSTBYNAME_R=1 -DGETHOSTBYNAME_R_RETURNS_INT=1 -DHAVE_LIBRT=1 -DNDEBUG=1 -DTORRENT_USE_OPENSSL=1 -DHAVE_PYTHON=\"2.6\" -DHAVE_BOOST_PYTHON=1 -DHAVE_LINUX_TYPES_H=1 -DHAVE_LINUX_FIEMAP_H=1 -DWITH_SHIPPED_GEOIP_H=1 -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE=1 -DBOOST_ASIO_ENABLE_CANCELIO=1 -DBOOST_ASIO_DYN_LINK=1 -DTORRENT_BUILDING_SHARED=1
Build options:
deprecated functions: yes
debug build: no
invariant checks: no
logging support: no
statistics: no
disk statistics: no
Features:
encryption support: yes
geoip support: yes
dht support: yes
pool allocators: yes
Extra builds:
examples: no
tests: no
python bindings: yes
Pthread library:
CFlags: -lpthread
Libs: -lpthread
Boost libraries:
version: 1.41
CPPFlags: -I/usr/include
LDFlags: -L/usr/lib64
boost.system: -lboost_system-mt
boost.python: -lboost_python
Python environment:
-automake-
binary: /usr/bin/python
version: 2.6
platform: linux2
prefix: ${prefix}
exec_prefix: ${exec_prefix}
pythondir: ${prefix}/lib/python2.6/site-packages
pkgpythondir: ${pythondir}/libtorrent-rasterbar
pyexecdir: ${exec_prefix}/lib64/python2.6/site-packages
pkgpyexecdir: ${pyexecdir}/libtorrent-rasterbar
-m4-
cppflags: -I/usr/include/python2.6
ldflags: -L/usr/lib64 -lpython2.6
extra libs: -lpthread -ldl -lutil
extra ldflags: -Xlinker -export-dynamic
External libraries:
system libgeoip: no
system libiconv: no
OpenSSL library:
OpenSSL Libs: -lssl -lcrypto -ldl -lz
OpenSSL LDFlags:
OpenSSL Includes:
Re: deluged error "ImportError: No module named libtorrent"
Posted: Sat Sep 21, 2013 11:08 pm
by crishna
the command make failed, after the configure, I get this output (last few lines)
Code: Select all
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I../../include -I/usr/include -I/usr/include/python2.6 -c src/torrent_info.cpp -o build/temp.linux-x86_64-2.6/src/torrent_info.o -DTORRENT_USE_OPENSSL -DWITH_SHIPPED_GEOIP_H -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_DYN_LINK -DTORRENT_LINKING_SHARED
In file included from src/torrent_info.cpp:6:
../../include/libtorrent/torrent_info.hpp: In member function 'void libtorrent::torrent_info::rename_file(int, const std::wstring&)':
../../include/libtorrent/torrent_info.hpp:287: warning: 'void libtorrent::file_storage::rename_file(int, const std::wstring&)' is deprecated (declared at ../../include/libtorrent/file_storage.hpp:197)
In file included from /usr/include/boost/python/to_python_indirect.hpp:10,
from /usr/include/boost/python/converter/arg_to_python.hpp:10,
from /usr/include/boost/python/call.hpp:15,
from /usr/include/boost/python/object_core.hpp:12,
from /usr/include/boost/python/args.hpp:25,
from /usr/include/boost/python.hpp:11,
from src/torrent_info.cpp:5:
/usr/include/boost/python/object/pointer_holder.hpp: In member function 'void* boost::python::objects::pointer_holder<Pointer, Value>::holds(boost::python::type_info, bool) [with Pointer = boost::intrusive_ptr<const libtorrent::torrent_info>, Value = const libtorrent::torrent_info]':
src/torrent_info.cpp:290: instantiated from here
/usr/include/boost/python/object/pointer_holder.hpp:145: error: invalid conversion from 'const void*' to 'void*'
/usr/include/boost/python/object/pointer_holder.hpp:145: error: initializing argument 1 of 'void* boost::python::objects::find_dynamic_type(void*, boost::python::type_info, boost::python::type_info)'
/usr/include/boost/python/object/pointer_holder.hpp:145: error: invalid conversion from 'const void*' to 'void*'
error: command 'gcc' failed with exit status 1
make[2]: *** [all-local] Error 1
make[2]: Leaving directory `/root/git-repository/libtorrent/libtorrent-rasterbar-0.16.11/bindings/python'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/git-repository/libtorrent/libtorrent-rasterbar-0.16.11/bindings'
make: *** [all-recursive] Error 1
Re: deluged error "ImportError: No module named libtorrent"
Posted: Sat Sep 21, 2013 11:12 pm
by crishna
I get the same problem as this person, trying to find out how to fix this...
http://code.google.com/p/libtorrent/iss ... ail?id=507