What pip package contains deluge.ui.client?

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

What pip package contains deluge.ui.client?

Post by kingram »

I had a pretty good environment setup with Deluge 1.3 to check status of torrents using the CLI
Now that Deluge 2.1.1 is the only version to use with Python 3.12+, my tool is not working.

The documentation at https://deluge-torrent.org/development/uiclient/ does not indicate what deluge client package is required, and where to obtain it.

I can't install deluge-client (pypi search) in a python 3.12 environment:

Code: Select all

$ pip3 install deluge-client
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
And of course python 2.7 is not a reasonable choice.

Code: Select all

$ pip install deluge-client
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting deluge-client
  Downloading https://files.pythonhosted.org/packages/f1/53/d6672ad7b44190d578ce7520822af34e7119760df9934cad4d730b0592a2/deluge-client-1.10.2.tar.gz
Installing collected packages: deluge-client
  Running setup.py install for deluge-client ... done
Successfully installed deluge-client-1.10.2
WARNING: You are using pip version 19.2.3, however version 20.3.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Code: Select all

$ python tmonitor.py 
Traceback (most recent call last):
  File "tmonitor.py", line 3, in <module>
    from deluge.ui.client import client
ImportError: No module named deluge.ui.client
My tool, tmonitor:

Code: Select all

import math
import sys
from deluge.ui.client import client
from twisted.internet import reactor

class DelugeInfo:
  
  def __init__(self):
    self.records = []
    self.categories = []
    self.torrents_status = []

    try:
      d = client.connect()
      d.addCallback(self.on_connect_successful)
      d.addErrback(self.on_connect_fail)
      reactor.run()
    except Exception as e:
      self.logError("Error: " + str(e))


  def on_get_torrents_status(self, torrents_status):
    self.torrents_status = torrents_status
    client.disconnect()
    reactor.stop()

  def on_connect_successful(self, result):
    print("Connection Successful")
    client.core.get_torrents_status("", "").addCallback(self.on_get_torrents_status)

  def on_connect_fail(self, result):
    print("Connection Failed!")

  def writeOutput(self):
    print("Write Output")

  def logError(self, text):
    print("Line 38: " + text + "\n")

def main():
  delugeInfo = DelugeInfo()
  # delugeInfo.writeOutput()

if __name__ == '__main__':
  main()
  sys.exit()
User avatar
ambipro
Moderator
Moderator
Posts: 672
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: What pip package contains deluge.ui.client?

Post by ambipro »

https://pypi.org/project/deluge/

Lists the packages and their dependencies (optional) and how to install them. Pypi is the pip "repo" if you will.

GTK is the client itself, but you probably want to install [all]
User avatar
ambipro
Moderator
Moderator
Posts: 672
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: What pip package contains deluge.ui.client?

Post by ambipro »

Also, if you're looking for a separate module for this, you can check out autotorrent's creator's deluge client https://pypi.org/project/deluge-client/

But it sounds like you're trying to just drop it into the new version, and it may or may not even work if it was designed around 1.x
Post Reply