Deluge.ui.client not importing in python

Specific support for Deluge on Microsoft Windows OS
Post Reply
Divc09
New User
New User
Posts: 4
Joined: Wed Oct 26, 2016 2:06 pm

Deluge.ui.client not importing in python

Post by Divc09 »

Ok so this forum is my last hope. I have been trying to get this to script to work for days at this point. The OS is windows 7 btw.

Code: Select all

#!/usr/bin/python

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

# Set up the logger to print out errors
from deluge.log import setupLogger
setupLogger()

d = Client.connect()

torrent_id = sys.argv[1]

def on_connect_success(result):
    def on_get_torrent_status(torrent):
        print (torrent["label"]);
        client.disconnect()
        reactor.stop()

    client.core.get_torrent_status(torrent_id, ["label"]).addCallback(on_get_torrent_status)

d.addCallback(on_connect_success)

def on_connect_fail(result):
        print (result);
        reactor.stop()

d.addErrback(on_connect_fail)

reactor.run()

The line with the error is "from deluge.ui.client import client"
I have wasted hours on it and i still get the same error no matter what I do which is

Traceback (most recent call last):
File "C:\Scripts\getLabel.py", line 5, in <module>
from deluge.ui.client import client
ImportError: No module named 'deluge'

This is with python. Does anyone have the slightest clue about what to do to get this working. If someone knows how to fix this please reply or even if you could just provide additional info. I really need this. Thanks a million to anyone who helps. I just want to import the client and I have restarted deluge multiple times with both classic mode enabled and disabled to no avail. Please help if someone knows how to as multiple people are using this script. Thanks again. Hoping that it works this time.
Post Reply