Page 4 of 4

Re: Torrent list empty but upload and downloads in progress

Posted: Sun Feb 20, 2022 2:59 pm
by israuor
okay.. here we go.. apt list python3-libtorrent:

Code: Select all

python3-libtorrent/bionic,bionic,now 1.2.15~daily10744+019fcc32b-202202200724~ubuntu18.04.1 amd64 [installed]
N: There is 1 additional version. Please use the '-a' switch to see it
ahh.. with '-a' switch it shows me 2 versions.

Code: Select all

python3-libtorrent/bionic,bionic,now 1.2.15~daily10744+019fcc32b-202202200724~ubuntu18.04.1 amd64 [installed]
python3-libtorrent/bionic 1.1.5-1build1 amd64
python3 -c "import libtorrent; print(libtorrent.version)"

Code: Select all

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'libtorrent'

Re: Torrent list empty but upload and downloads in progress

Posted: Sun Feb 20, 2022 3:18 pm
by israuor
another thing... python-libtorrent was still old version.. after removing it and trying to install newer version with apt i get
sudo apt install python-libtorrent

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-libtorrent : Depends: libtorrent-rasterbar10 (= 1.2.6~daily10509+f4d58ae4b-202012201550~ubuntu18.04.1) but 1.2.15~daily10744+019fcc32b-202202200724~ubuntu18.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.

Re: Torrent list empty but upload and downloads in progress

Posted: Sun Feb 20, 2022 4:07 pm
by mhertz
Thanks. I don't know why cannot import libtorrent honestly, but in your last post you try install python-libtorrent, which is python2, not 3.

If me, I'd try uninstall all libtorrent/bindings first, and btw, the pypi libtorrent have no wheels for py3.6,only 3.7 and up, so need focus on PPA as you do, just noting(and think 18.04 uses py3.6 - btw not even sure deluge-dev still support that currently(will check later), atleast was some talk in a PR about which route to go henceforth, but unsure about status-quo, and not that, since libtorrent don't import outside deluge neither).

I'd try all these and some fail probably, as just in case, can try other sequencing if issue:

sudo apt remove python3-libtorrent
sudo apt remove python-libtorrent
sudo apt remove libtorrent-rasterbar10
sudo apt remove libtorrent-rasterbar9

Then, 'sudo apt install python3-libtorrent', and try again, and also: python3 -c "import libtorrent; print(libtorrent.version)".

I'll test later in a 18.04 livecd VM, when have time, to make sure not other issue, if you haven't replied back before.

Edit: You can probably not uninstall libtorrent when deluge installed, atleast without extra switches to apt, so I'd uninstall deluge firstly, and then rest commands, followed by reinstall deluge from apt, which should install libtorrent also by itself.

Re: Torrent list empty but upload and downloads in progress

Posted: Sun Feb 20, 2022 6:17 pm
by mhertz
Indeed there's an issue, so understand your problem, and not your fault atleast :)

Haven't found reason yet, but adding libtorrent 1.2-daily PPA and installing python3-libtorrent, cannot import libtorrent module from python3 strangely, saying module not found as you posted. I googled it and after reading 3 stackoverflow/superuser threads about this, where a solution posted but no explenation given in any of them, despite requested. Anyway, i'll edit in the reason later, when digging little depper, but for now atleast solution available.

There's a forked libtorrent python-wrapper on pypi working, so install that to fix - In the latest 18.04(.6) livecd ISO I tested this in, then pip not installed by default, so probably need that also, with 'sudo apt install python3-pip'. Then install working libtorrent python-wrapper fork with: 'sudo pip3 install lbry-libtorrent'. Now the importing works, as I tested it returning 1.2.4 through 'python3 -c "import libtorrent; print(libtorrent.version'' - I didn't check deluge, but should work.

Note 'apt list libtorrent-rasterbar10' shows v1.2.15, so latest 1.2.x installed correct as per the PPA, so the 1.2.4 returned previously from libtorrent python-module import-test must've been version of the pypi forked python-bindings and not main lib, i'm presuming here. Would be nicer having matching versions though(I haven't checked if even linked, or static, though).

Edit: Still haven't found reason :( Cas has added libtorrent 1.2.x to his deluge-develop PPA, so don't need additional libtorrent 1.2-daily PPA(remove with 'sudo add-apt-repository ppa:libtorrent.org/1.2-daily -r'), though I also tried through that, and same scenario i.e. cannot import - I also installed python3.7 and made default for python3 and reinstalled, but still same story, though pypi libtorrent then atleast becomes a possibility(as pre-built wheels py3.7+ - need remove apt version first, to install however).

Edit2: Don't have more time now for this, will look more into it tomorrow - maybe to old boost I'm thinking, I believe was 1.65(not at my computer now) , and not sure supported, but will check tomorrow. Also, the posted workaround I repeated here, lbry-libtorrent from pypi, probably is "standalone" so not even using/needing apt's libtorrent-rasterbar10, so probably is ibtorrent 1.2.4 afterall(and not just binding-version, as libtorrent.version queried afterall, but don't understand how then can be none/any for wheel py-version, but will check with ldd tomorrow). Anyway atleast fulfills requirement of min 1.2, so quick/easy workaround for now.

Edit3: Still not time today yet, but finally found its github on my phone, as not listed on pypi - the github-actions yaml file seemingly reveals static 3.7 build, using boost 1.70 or above(removed, but specified in previous commits), and libtorrent build docs states boost 1.69+ needed, so probably that. Strange works on py3.6, as on windows had to rebuild upon such, well that was in upped not lower py-ver though, but still states "any", so probably different on Linux. Will find out this evening for sure probably(I'll probably build a 18.04 wheel of 1.2.15 and post here, till fixed).

Re: Torrent list empty but upload and downloads in progress

Posted: Tue Feb 22, 2022 1:38 am
by mhertz
Here's libtorrent-1.2.15-py3-none-any.whl, with libtorrent and boost statically linked-in, so self-contained, in wheel format. The others from PPAs links dynamically to system-installed boost, and is 1.65 on ubuntu 18.04, and pretty sure this is the culprit, but haden't time to test that yet, sorry. I added a PPA for newer boost, but still missed py-bindings for it, so when trying get that from a newer ubuntu deb package, then failed with dep-issue, so focused on building a self-contained version for 18.04 users instead.

If not having pip3, then install first with 'sudo apt install python3-pip', and then afterwards download my python3-libtorrent build and install with: 'sudo pip3 install -U libtorrent-1.2.15-py3-none-any.whl'(Need the '-U' to force the install when already there from apt). Afterwards libtorrent python-module is importable and deluge works again. Can be completely removed again with: 'sudo pip3 uninstall libtorrent'. Note, only tested on ubuntu 18.04, fully updated, so python 3.6.x.

Anyway, nothing to "fix" for PPA/libtorrent, as is issue of using old distro version merely, well if i'm right in my assumption atleast.

Edit: I screwed up the wheel naming, sorry(made manually, as used b2 not setup.py for building), this is a x64 build, and don't know if work in over py3.6. I'll build 32bit version later and edit in. *No x32 version of ubuntu-18.04, so will not build that anyway.

Edit2: I built with boost1.65 to test, and had the "couldn't find / import error", so seemingly that indeed was culprit. *Though find also cannot link static to boost in under boost 1.74, so gotta test more probably.