Page 1 of 1
Building v2.0.3 on MacOSX with Homebrew
Posted: Sat Mar 20, 2021 7:34 pm
by amar1729
Saw another post where a user built Deluge under MacPorts (
viewtopic.php?f=13&t=55622) so I figured I'd make a Homebrew tap for it.
Link here:
https://github.com/amar1729/homebrew-deluge-meta
This formula is called
deluge-meta
since I originally meant it to be a meta-package provided deluge's dependencies, as specified by the 2.0.3 docs (
https://deluge.readthedocs.io/en/deluge ... stall.html). However, it turned into a full install of
deluge
and
deluge-gtk
.
This formula does NOT build a .app - instead, you can start deluge by calling
deluge-gtk
from the command line. This works for me on Mojave, but should work on Catalina as well.
Feel free to look over the formula before installing if you don't trust it (or fork it yourself and install it) - it's fairly straightforward.
----
06/10/22 Edit to add - while the title says v2.0.3, I do try to keep the formula up-to-date with pypi releases. The most recent bottle is for the 2.0.5 release. This tap will also build from source on M1 Macs (where
deluge
and
deluge-gtk
, the GUI parts as thin or standalone, currently work fine)
Re: Building v2.0.3 on MacOSX with Homebrew
Posted: Wed Apr 28, 2021 7:04 pm
by Steve-luo
Thanks for sharing! Any idea why the 2.0.3 gui is sluggish and laggy? This is the same for both the .app build and when I launch deluge-gtk.
Re: Building v2.0.3 on MacOSX with Homebrew
Posted: Thu Apr 29, 2021 5:03 am
by amar1729
No problem! I'm not sure - honestly, i'm not seeing the same problem, although I'm only using deluge GUI as a thin client to connect to my server.
Re: Building v2.0.3 on MacOSX with Homebrew
Posted: Sun Oct 16, 2022 10:09 am
by ophidio
I've build the formula and seem to work. Only i cannot see may LabelPlus tab like the plugin not working. Under Windows thinclient work good.
Re: Building v2.0.3 on MacOSX with Homebrew
Posted: Sat Mar 15, 2025 9:47 pm
by phunkyfish
This works great for the thin client, which I use all the time.
Today I tried to run the daemon, both trying the service startup and just calling deluged directly. But I get this error:
Code: Select all
➜ bin deluged
➜ bin Traceback (most recent call last):
File "/opt/homebrew/Cellar/deluge-meta/2.1.1_5/libexec/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 "/opt/homebrew/Cellar/deluge-meta/2.1.1_5/libexec/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 "/opt/homebrew/Cellar/deluge-meta/2.1.1_5/libexec/bin/deluged", line 8, in <module>
sys.exit(start_daemon())
^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/deluge-meta/2.1.1_5/libexec/lib/python3.12/site-packages/deluge/core/daemon_entry.py", line 87, in start_daemon
from deluge.core.daemon import is_daemon_running
File "/opt/homebrew/Cellar/deluge-meta/2.1.1_5/libexec/lib/python3.12/site-packages/deluge/core/daemon.py", line 19, in <module>
from deluge.core.core import Core
File "/opt/homebrew/Cellar/deluge-meta/2.1.1_5/libexec/lib/python3.12/site-packages/deluge/core/core.py", line 26, in <module>
from deluge._libtorrent import LT_VERSION, lt
File "/opt/homebrew/Cellar/deluge-meta/2.1.1_5/libexec/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'
Any idea what is happening there?
Re: Building v2.0.3 on MacOSX with Homebrew
Posted: Mon Mar 17, 2025 9:56 am
by ambipro
Well, you're missing libtorrent. You need to install libtorrent, if brew has that module, install it.
Re: Building v2.0.3 on MacOSX with Homebrew
Posted: Fri Apr 25, 2025 9:41 am
by amar1729
The problem above was due to a homebrew/python mismatch (homebrew's libtorrent had been updated to depend on py3.13, while this deluge formula hadn't).
Bumping this uncovered another error, which is that cgi has been deprecated in py3.13 but Deluge hasn't been updated (either to not use it or to require e.g legacy-cgi
https://pypi.org/project/legacy-cgi/):
Code: Select all
$ .venv/bin/deluged -d
Traceback (most recent call last):
File "/opt/homebrew/Library/Taps/amar1729/homebrew-deluge-meta/.venv/bin/deluged", line 10, in <module>
sys.exit(start_daemon())
~~~~~~~~~~~~^^
File "/opt/homebrew/Library/Taps/amar1729/homebrew-deluge-meta/.venv/lib/python3.13/site-packages/deluge/core/daemon_entry.py", line 87, in start_daemon
from deluge.core.daemon import is_daemon_running
File "/opt/homebrew/Library/Taps/amar1729/homebrew-deluge-meta/.venv/lib/python3.13/site-packages/deluge/core/daemon.py", line 19, in <module>
from deluge.core.core import Core
File "/opt/homebrew/Library/Taps/amar1729/homebrew-deluge-meta/.venv/lib/python3.13/site-packages/deluge/core/core.py", line 55, in <module>
from deluge.httpdownloader import download_file
File "/opt/homebrew/Library/Taps/amar1729/homebrew-deluge-meta/.venv/lib/python3.13/site-packages/deluge/httpdownloader.py", line 9, in <module>
import cgi
ModuleNotFoundError: No module named 'cgi'
To fix this, i simply included
legacy-cgi
in the formula, as it seems to be a drop-in replacement.
In fact, there are only three occurrences
cgi
: two in
httpdownloader
and one in
web.json_api
, both of which only use
cgi.parse_header
. It may be straightforward to update those to the corresponding
urllib.parse
calls.
Re: Building v2.0.3 on MacOSX with Homebrew
Posted: Fri Apr 25, 2025 10:35 am
by mhertz
Thanks buddy, appreciate you

(had been to lazy myself to make PR adding the removed cgi back, from said pypi package, though then also thought like you, that the few places actually using it, just could be changed, though never came longer than that honestly, but thanks for the suggested replacement commands).
Edit: I'm an idiot sorry, as see already fixed last year by mtasaka in dev branch.