deluged error "ImportError: No module named libtorrent"

General support for problems installing or using Deluge
crishna
Member
Member
Posts: 18
Joined: Sat Sep 21, 2013 5:17 pm

Re: deluged error "ImportError: No module named libtorrent"

Post by crishna »

well, I think I was maybe using the wrong libtorrent... I will try the one from google...

I was using :libtorrent-rasterbar-0.16.11
now I will switch to the : git clone https://code.google.com/p/libtorrent/ which seems to be used also by deluge 1.3
crishna
Member
Member
Posts: 18
Joined: Sat Sep 21, 2013 5:17 pm

Re: deluged error "ImportError: No module named libtorrent"

Post by crishna »

./autotool.sh worked,

I did the configure as ./configure --with-boost-libdir="/usr/lib64" --enable-python-binding, worked

currently compiling "make" the other libtorrent from google code site... posting progress...
crishna
Member
Member
Posts: 18
Joined: Sat Sep 21, 2013 5:17 pm

Re: deluged error "ImportError: No module named libtorrent"

Post by crishna »

make failed. I am nut sure what to do, well, I do not know what to do, can someone help on this !?

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/string.cpp -o build/temp.linux-x86_64-2.6/src/string.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
src/string.cpp: In static member function 'static void unicode_from_python::construct(PyObject*, boost::python::converter::rvalue_from_python_stage1_data*)':
src/string.cpp:31: error: 'libtorrent' has not been declared
src/string.cpp:52: error: 'wchar_utf8' was not declared in this scope
src/string.cpp:52: warning: unused variable 'ret'
error: command 'gcc' failed with exit status 1
make[2]: *** [all-local] Error 1
make[2]: Leaving directory `/root/git-repository/temp/libtorrent/bindings/python'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/git-repository/temp/libtorrent/bindings'
make: *** [all-recursive] Error 1
crishna
Member
Member
Posts: 18
Joined: Sat Sep 21, 2013 5:17 pm

Re: deluged error "ImportError: No module named libtorrent"

Post by crishna »

I am no code, but here is the code of this file at the lines 31 and 52

Code: Select all

 29     static void construct(PyObject* x, converter::rvalue_from_python_stage1_data* data)
 30     {
 31         using libtorrent::wchar_utf8;
 32         void* storage = ((converter::rvalue_from_python_storage<
 33             std::string>*)data)->storage.bytes;
 34
 35         if (PyUnicode_Check(x))
 36         {
 37             std::wstring str;
 38             str.resize(PyUnicode_GetSize(x) + 1, 0);
 39 #if PY_VERSION_HEX >= 0x03020000
 40             int len = PyUnicode_AsWideChar(x, &str[0], str.size());
 41 #else
 42             int len = PyUnicode_AsWideChar((PyUnicodeObject*)x, &str[0], str.size());
 43 #endif
 44             if (len > -1)
 45             {
 46                assert(len < str.size());
 47                str[len] = 0;
 48             }
 49             else str[str.size()-1] = 0;
 50
 51             std::string utf8;
 52             int ret = wchar_utf8(str, utf8);
 53             new (storage) std::string(utf8);
 54         }
 55         else
 56         {
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: deluged error "ImportError: No module named libtorrent"

Post by Cas »

Again you need to check before using a git repo as the libtorrent one is not up to date and the code repository is actually located here: http://sourceforge.net/p/libtorrent/cod ... s/RC_0_16/

Use the "Download snapshot" to get a zip of the RC16 source code with a potential fix as specified in that bug report.

The alternative is to use libtorrent 0.15.10.
crishna
Member
Member
Posts: 18
Joined: Sat Sep 21, 2013 5:17 pm

Re: deluged error "ImportError: No module named libtorrent"

Post by crishna »

ok great. I used the source mentioned above, autotool ok, configure ok, make and make install fine, re did process for deluged with the python scripts, went fine, executed deluged, same results.

Code: Select all

$ [ERROR   ] 15:30:57 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
I will have to try libtorrent 0.15.10 apparently, I will expect the same results!
crishna
Member
Member
Posts: 18
Joined: Sat Sep 21, 2013 5:17 pm

Re: deluged error "ImportError: No module named libtorrent"

Post by crishna »

ok, too many things compiled I guess, ill try to get rid of all traces of these files in my system and restart from scratch, with what you provided.
crishna
Member
Member
Posts: 18
Joined: Sat Sep 21, 2013 5:17 pm

Re: deluged error "ImportError: No module named libtorrent"

Post by crishna »

still no success.

Code: Select all

fdesfoss@linux.crishna.local /home/fdesfoss
$ [ERROR   ] 17:09:49 main:237 libtorrent-rasterbar.so.7: cannot open shared object file: No such file or directory
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: libtorrent-rasterbar.so.7: cannot open shared object file: No such file or directory
crishna
Member
Member
Posts: 18
Joined: Sat Sep 21, 2013 5:17 pm

Re: deluged error "ImportError: No module named libtorrent"

Post by crishna »

seemed that I needed to move the library to the /usr/lib64 folder, they where in /usr/lib folder. now process deluged start without error, trying the interface now.
crishna
Member
Member
Posts: 18
Joined: Sat Sep 21, 2013 5:17 pm

Re: deluged error "ImportError: No module named libtorrent"

Post by crishna »

case close, this was the issue! thanks for your help!
Post Reply