No module named 'deluge.libtorrent', 2.1.1 on Ubuntu 20.04

General support for problems installing or using Deluge
Post Reply
mortoray
New User
New User
Posts: 1
Joined: Thu Sep 22, 2022 4:31 pm

No module named 'deluge.libtorrent', 2.1.1 on Ubuntu 20.04

Post by mortoray »

I upgraded to version 2.1.1 today and am getting a `No module named 'deluge.libtorrent'` error.

I've tried uninstalling, reinstalling, including the libtorrent package, but nothing seems to help.

Code: Select all

18:48:18 [ERROR   ][deluge.ui.gtk3.gtkui              :1343] No libtorrent library found: No module named 'libtorrent'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-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 "/usr/lib/python3/dist-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 "/usr/lib/python3/dist-packages/deluge/ui/gtk3/gtkui.py", line 309, in _on_reactor_start
    client.start_standalone()
  File "/usr/lib/python3/dist-packages/deluge/ui/client.py", line 637, in start_standalone
    self._daemon_proxy = DaemonStandaloneProxy(self.__event_handlers)
  File "/usr/lib/python3/dist-packages/deluge/ui/client.py", line 458, in __init__
    from deluge.core import daemon
  File "/usr/lib/python3/dist-packages/deluge/core/daemon.py", line 19, in <module>
    from deluge.core.core import Core
  File "/usr/lib/python3/dist-packages/deluge/core/core.py", line 26, in <module>
    from deluge._libtorrent import LT_VERSION, lt
  File "/usr/lib/python3/dist-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'
yozart
New User
New User
Posts: 3
Joined: Sun Oct 16, 2022 10:25 am

Re: No module named 'deluge.libtorrent', 2.1.1 on Ubuntu 20.04

Post by yozart »

got exact same issue in truenas jail 12.3.

see https://www.truenas.com/community/threa ... ost-713112
for all my install details

From what I saw, the issue is with the binding of the libtorrent library with python
I wasn't able to find anythng on this topic
yozart
New User
New User
Posts: 3
Joined: Sun Oct 16, 2022 10:25 am

Re: No module named 'deluge.libtorrent', 2.1.1 on Ubuntu 20.04

Post by yozart »

Apparently, this is a bug in libtorrent binding:
https://github.com/arvidn/libtorrent/issues/6890

Not sure what to do to fix! This is broken since march and didn't found any solution yet
fibulatactful
New User
New User
Posts: 2
Joined: Wed Nov 02, 2022 7:08 am

Re: No module named 'deluge.libtorrent', 2.1.1 on Ubuntu 20.04

Post by fibulatactful »

Is this issue still unresolved?
five nights at freddy's
mhertz
Moderator
Moderator
Posts: 1711
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: No module named 'deluge.libtorrent', 2.1.1 on Ubuntu 20.04

Post by mhertz »

The issue from OP regarding ubuntu 20.04 I just now tested in a VM and verified to atleast not be a general issue imho.

Install deluge from PPA or pypa on ubuntu 20.04, as main repo package is deluge 2.0.3, and make sure don't mix'n match e.g. libtorrent from main repo and deluge from PPA/pypa won't work, since deluge 2.1.1 doesn't support libtorrent 1.1.x like the main repo package provides and indeed would show such error I believe - check if that's the case(having libtorrent under 1.2.x) through e.g:

Code: Select all

python3 -c "import libtorrent; print(libtorrent.version)"
The truenas issue of yozart I cannot comment on sorry.
yozart
New User
New User
Posts: 3
Joined: Sun Oct 16, 2022 10:25 am

Fixed: No module named 'deluge.libtorrent', 2.1.1 on Ubuntu 20.04

Post by yozart »

Fix available in the truenas tpic. I proposed a patch in the github of truenas plugin based on the answer
Post Reply