Page 1 of 1

Building Deluge 2.0 / Libtorrent 1.2.2 against Python 3

Posted: Mon Nov 04, 2019 5:00 pm
by captaintrav
Trying to get off Python 2.7, on Ubuntu 16.04 (it looks like 18.04 still ships with Python 2.7 as well). When I run the configure script it looks okay:

Code: Select all

Python environment:
  -automake-
  binary:               /usr/bin/python
  version:              3.5
  platform:             linux
  prefix:               ${prefix}
  exec_prefix:          ${exec_prefix}
  pythondir:            ${prefix}/lib/python3.5/site-packages
  pkgpythondir:         ${pythondir}/libtorrent-rasterbar
  pyexecdir:            ${exec_prefix}/lib/python3.5/site-packages
  pkgpyexecdir:         ${pyexecdir}/libtorrent-rasterbar

  -m4-
  cppflags:             -I/usr/include/python3.5m
  ldflags:
  extra libs:           -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
When I install it though, it looks like it's linked against Libboost for Python 2.7?

Code: Select all

Python 3.5.2 (default, Oct  8 2019, 13:06:37)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.q
>>> import libtorrent
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0: undefined symbol: PyClass_Type
>>>
libboost-python dev installs libraries for both Python 2.7 and 3.5, so no way to avoid that, I just don't know what I'm missing. I'm not a developer but have successfully built deluge in the past using the documented steps on Ubuntu. I tried getting Deluge 2.0.3 from the PPA, but it depends on libtorrent >= 1.1.1 which I can't find in any Ubuntu 16.04 repo.

Re: Building Deluge 2.0 / Libtorrent 1.2.2 against Python 3

Posted: Mon Nov 04, 2019 9:16 pm
by captaintrav
Solved, changed the symbolic links:

Code: Select all

/usr/lib/x86_64-linux-gnu/libboost_python.a 
and .so 
To point to the python 3.5 version:

Code: Select all

 libboost_python.so -> libboost_python-py35.so
 libboost_python.a -> libboost_python-py35.a
After that libtorrent loads in Python3.5 okay. (after building and installing the libtorrent python bindings again)... I had to pull in some more packages into python3.5 that deluge was complaining about (zope-interface and I can't remember all what), but it works now!