Torrents won't delete

General support for problems installing or using Deluge
nSpectre
New User
New User
Posts: 6
Joined: Fri Sep 15, 2017 12:06 am

Re: Torrents won't delete

Post by nSpectre »

Thanks for that, novamanus.

I tried it in 3.8 but just get a ModuleNotFoundError: No module named 'deluge.libtorrent':

Code: Select all

File "/usr/lib/python3/dist-packages/deluge/_libtorrent.py", line 23, in <module>
    import deluge.libtorrent as lt
ModuleNotFoundError: No module named 'deluge.libtorrent'
Do you by chance have a clue for the clueless like me? :D

I did confirm that that file does exist at that path.

I do notice that the error produced is missing an underscore in the line "import deluge.libtorrent as lt" and the example given in _libtorrent.py does have an underscore. Yet the uncommented code in _libtorrent.py doesn't use an underscore. Which just makes me go cross-eyed.

I dorked around with it a bit by adding underscores, but then it just threw all kinds of other errors so I gave up. I don't know jack about Python. :)
novamanus
New User
New User
Posts: 5
Joined: Wed Sep 03, 2014 2:53 pm

Re: Torrents won't delete

Post by novamanus »

Hi nSpectre.

Sure, lets see if we can get this to work for you.

First thing, can you post the commands you ran? We shouldn't be importing from deluge.libtorrent with this script.

Also, off the top of my head from seeing that error message, I'd ask if there's a deluge-dev or similar development/header package that you can install.
nSpectre
New User
New User
Posts: 6
Joined: Fri Sep 15, 2017 12:06 am

Re: Torrents won't delete

Post by nSpectre »

Sorry. Got busy.

I'll try again tomorrow evening. :)
granjerox
New User
New User
Posts: 5
Joined: Mon Aug 12, 2019 6:09 pm

Re: Torrents won't delete

Post by granjerox »

Thanks @novamanus it worked like a charm.

Ubuntu 18.04

Code: Select all

granjerox@nuc:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.4 LTS
Release:	18.04
Codename:	bionic
Python3.6

Code: Select all

granjerox@nuc:~$ dpkg -l |egrep 'python3-six|python3\s+3'
ii  python3         3.6.7-1~18.04   amd64  interactive high-level object-oriented language (default python3 version)
ii  python3-six     1.11.0-2        all    Python 2 and 3 compatibility library (Python 3 interface)
deluge 2.1.1

Code: Select all

granjerox@nuc:~$ dpkg -l |grep deluge
ii  deluge-common    2.1.1~dev7516+23a48dd-202005101213~ubuntu18.04.1   all   Deluge Common Files
ii  deluge-console   2.1.1~dev7516+23a48dd-202005101213~ubuntu18.04.1   all   Deluge Console UI
ii  deluge-gtk       2.1.1~dev7516+23a48dd-202005101213~ubuntu18.04.1   all   Deluge GTK UI
ii  deluge-web       2.1.1~dev7516+23a48dd-202005101213~ubuntu18.04.1   all   Deluge Web UI
ii  deluged          2.1.1~dev7516+23a48dd-202005101213~ubuntu18.04.1   all   Deluge Daemon (deluged)
novamanus
New User
New User
Posts: 5
Joined: Wed Sep 03, 2014 2:53 pm

Re: Torrents won't delete

Post by novamanus »

Awesome, I'm glad to hear it!
GoodNewsEveryone
New User
New User
Posts: 1
Joined: Wed Aug 24, 2022 2:04 am

Re: Torrents won't delete

Post by GoodNewsEveryone »

This was happening to me as well. I tried the previous suggestion, but was getting the missing libtorrent module no matter what I tried.

I found a solution though, incredibly simple it's kind of funny. Just go to the state folder and delete the torrent there.

First you need to find the hash of the torrent you want to delete by clicking on the torrent and going to details in the bottom panel. Like novamanus said it might disappear. If that happens just hard reset Deluge and you should be able to find it.

If you're on windows navigate to C:\Users\YOURUSERNAME\AppData\Roaming\deluge\state

You'll see a list of torrent files there, find the one that has the same hash as the torrent you want to delete then delete that file.

It worked for me so far with no problems.
Post Reply