deluged does not start. No libtorrent library found: No module named 'libtorrent'

General support for problems installing or using Deluge
Post Reply
kingram
Member
Member
Posts: 13
Joined: Sun Nov 10, 2024 7:21 pm

deluged does not start. No libtorrent library found: No module named 'libtorrent'

Post by kingram »

I created a torrent process monitoring tool using deluge development environment under Debian Wheezy with Python 2.7 and deluge 1.3

I built a new bare metal server with Ubunbtu 24.04 and I am attempting to run this tool with python3 and I am running into problems
Deluge 2.1 appears to be the default version.

What is the fix to this error?

Code: Select all

$ deluged
[85/1232] (kingram@apollo): 2024-11-10 11:58:15 ~/PROJECTS/tormonitor
$ Traceback (most recent call last):
  File "/home/kingram/.local/share/pipx/venvs/deluge/lib/python3.12/site-packages/deluge/_libtorrent.py", line 21, in <module>
    import deluge.libtorrent as lt
ModuleNotFoundError: No module named 'deluge.libtorrent'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kingram/.local/share/pipx/venvs/deluge/lib/python3.12/site-packages/deluge/_libtorrent.py", line 24, in <module>
    import libtorrent as lt
ModuleNotFoundError: No module named 'libtorrent'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kingram/.local/bin/deluged", line 8, in <module>
    sys.exit(start_daemon())
             ^^^^^^^^^^^^^^
  File "/home/kingram/.local/share/pipx/venvs/deluge/lib/python3.12/site-packages/deluge/core/daemon_entry.py", line 87, in start_daemon
    from deluge.core.daemon import is_daemon_running
  File "/home/kingram/.local/share/pipx/venvs/deluge/lib/python3.12/site-packages/deluge/core/daemon.py", line 19, in <module>
    from deluge.core.core import Core
  File "/home/kingram/.local/share/pipx/venvs/deluge/lib/python3.12/site-packages/deluge/core/core.py", line 26, in <module>
    from deluge._libtorrent import LT_VERSION, lt
  File "/home/kingram/.local/share/pipx/venvs/deluge/lib/python3.12/site-packages/deluge/_libtorrent.py", line 26, in <module>
    raise LibtorrentImportError('No libtorrent library found: %s' % (ex))
deluge.error.LibtorrentImportError: No libtorrent library found: No module named 'libtorrent'
System Info:

Code: Select all

Distributor ID: Ubuntu
Description:    Ubuntu 24.04.1 LTS
Release:        24.04
Codename:       noble
libtorrent-dev info

Code: Select all

Package: libtorrent-dev
Version: 0.13.8-2.1build2
Priority: extra
Section: universe/libdevel
Source: libtorrent
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Jose Luis Rivas <ghostbar@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 423 kB
Depends: libsigc++-2.0-dev, libtorrent21t64 (= 0.13.8-2.1build2)
Homepage: https://rakshasa.github.io/rtorrent/
Download-Size: 53.9 kB
APT-Manual-Installed: yes
APT-Sources: http://us.archive.ubuntu.com/ubuntu noble/universe amd64 Packages
Description: C++ BitTorrent library by Rakshasa (development files)
 LibTorrent is a BitTorrent library written in C++ for *nix. It is
 designed to avoid redundant copying and storing of data that other
 clients and libraries suffer from.
 .
 This package contains the files needed to compile and link programs which use LibTorrent.
deluged info

Code: Select all

Package: deluged
Version: 2.1.2~dev0+20240121-1
Priority: optional
Section: universe/net
Source: deluge
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Daniel Baumann <daniel.baumann@progress-linux.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 72.7 kB
Depends: deluge-common (= 2.1.2~dev0+20240121-1), passwd, python3-libtorrent, python3:any
Homepage: https://deluge-torrent.org
Download-Size: 15.7 kB
APT-Manual-Installed: yes
APT-Sources: http://us.archive.ubuntu.com/ubuntu noble/universe amd64 Packages
Description: multi-interface BitTorrent client (server)
 Deluge is a BitTorrent client written in Python. It uses a client-server
 model supporting multiple user-interfaces that can connect to a
 (headless) deluged running on a server.
 .
 This package contains the server.
mhertz
Moderator
Moderator
Posts: 2331
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: deluged does not start. No libtorrent library found: No module named 'libtorrent'

Post by mhertz »

Well you don't have a functioning libtorrent for deluged apparently - reason here being because your libTorrent is another lib, developed for rtorrent, so need libtorrent-rasterbar2.0t64, python3-libtorrent should pull right one in presumably. Also needs match py3.12. Don't really have experience with pipx, only manual venvs, where can control outside sys.path usage(system-site-packages=true), and last I saw pypi didn't have pre-built libtorrent for over py3.10 unfortunately.
User avatar
ambipro
Moderator
Moderator
Posts: 672
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: deluged does not start. No libtorrent library found: No module named 'libtorrent'

Post by ambipro »

mhertz wrote: Mon Nov 11, 2024 10:26 am Well you don't have a functioning libtorrent for deluged apparently - reason here being because your libTorrent is another lib, developed for rtorrent, so need libtorrent-rasterbar2.0 or something, python3-libtorrent should pull right one in presumably. Also needs match py3.12. Don't really have experience with pipx, only manual venvs, where can control outside sys.path usage(system-site-packages=true), and last I saw pypi didn't have pre-built libtorrent for over py3.10 unfortunately.
They recently merged workflows to build 2.x on pypi.

https://github.com/arvidn/libtorrent/pull/7727
mhertz
Moderator
Moderator
Posts: 2331
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: deluged does not start. No libtorrent library found: No module named 'libtorrent'

Post by mhertz »

Thanks bro for speeding it up with your request at upstream, asking if they need help, appreciated.
kingram
Member
Member
Posts: 13
Joined: Sun Nov 10, 2024 7:21 pm

Re: deluged does not start. No libtorrent library found: No module named 'libtorrent'

Post by kingram »

mhertz wrote: Mon Nov 11, 2024 10:26 am Well you don't have a functioning libtorrent for deluged apparently - reason here being because your libTorrent is another lib, developed for rtorrent, so need libtorrent-rasterbar2.0t64, python3-libtorrent should pull right one in presumably. Also needs match py3.12. Don't really have experience with pipx, only manual venvs, where can control outside sys.path usage(system-site-packages=true), and last I saw pypi didn't have pre-built libtorrent for over py3.10 unfortunately.
Not true. I have the library you mentioned installed:

Code: Select all

$ apt list libtorr*
Listing... Done
libtorrent-dev/noble,now 0.13.8-2.1build2 amd64 [installed]
libtorrent-rasterbar-dev/noble,now 2.0.10-1.1build2 amd64 [installed]
libtorrent-rasterbar-doc/noble,now 2.0.10-1.1build2 all [installed]
libtorrent-rasterbar2.0t64/noble,now 2.0.10-1.1build2 amd64 [installed,automatic]
libtorrent21t64/noble,now 0.13.8-2.1build2 amd64 [installed,automatic]
Post Reply