*OLD-THREAD - SEE NEW* [Unofficial] Deluge 2.0.x installer

Specific support for Deluge on Microsoft Windows OS
agapa
New User
New User
Posts: 5
Joined: Sun Mar 29, 2020 8:11 pm

Re: [Unofficial] Deluge 2.0.x installer.

Post by agapa »

Good news, thank you, mhertz! I haven't tried your new installer yet, want to finish what I'm doing. I'm struggling with libtorrent now, stuck on ImportError:

Code: Select all

>python -c "import libtorrent;"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: DLL load failed while importing libtorrent: The specified module could not be found.
It must be something simple, but I can't figure it out. The libtorrent library's compiled with runtime-link=static:

Code: Select all

b2 address-model=64 toolset=msvc-14.1 runtime-link=static link=static libtorrent-link=static boost-link=static encryption=on crypto=openssl openssl-lib=C:\Dev\OpenSSL\lib openssl-include=C:\Dev\OpenSSL\include optimization=space  release --hash --user-config=C:\Home\user-config.jam --build-dir=C:\Dev\Src\libtorrent-build > C:\Dev\Src\Logs\deluge-libtorrent.log 2>&1"
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Unofficial] Deluge 2.0.x installer.

Post by mhertz »

You have libcrypto* and libssl* in same folder as libtorrent.pyd i.e. Lib\site-packages folder under python install folder, or alternatively in system32?

Other than that, then I don't really know what the issue is honestly. I personally just edit setup.py from bindings\python folder of libtorrent, and just there add crypto=openssl and save file(well, I have everything scripted but regardless), but if not having openssl source in C:\OpenSSL-Win64(or some other default lookup paths), then you need add the extra options like you did for that. Also the runtime static option is fine, though I never bothered and just included the runtime file additionally, but have tested it previously that it works fine with that option. I don't specify the toolset option, as for python over 3.6 there is just used msvc from setup.py and that uses default installed msvc version. I use latest py3.7, so 3.77. I have msvc toolset 2015, 2017 and 2019 installed, plus 2017 community edition, but just use msvc 2019 toolset for the libtorrent building. Previously I needed msvc 2015 specifically for libtorrent 1.1.x, but they must have fixed it in later times because it works now with 2019, and the only thing I changed was change py3.6.x to py3.7.x, though because of that had to add a patch needed additionally I made. Anyway, libtorrent 1.2.x always worked for me with 2019 msvc, though I just now retested specifying msvc-14.1 as toolset like you did and there where no change in that and imported fine both manually and in deluge.
agapa
New User
New User
Posts: 5
Joined: Sun Mar 29, 2020 8:11 pm

Re: [Unofficial] Deluge 2.0.x installer.

Post by agapa »

Yes, libtorrent.pyd is in %pythonpath%, and all the libraries from its dependencies and libssl,libcrypto dll's are reachable.

Code: Select all

>dumpbin /dependents libtorrent.pyd
Dump of file libtorrent.pyd
File Type: DLL
  Image has the following dependencies:
    python38.dll
    libcrypto-1_1-x64.dll
    libssl-1_1-x64.dll
    IPHLPAPI.DLL
    WS2_32.dll
    WSOCK32.dll
    KERNEL32.dll
The only thing I can think of is that libssl/libcrypto have the C runtime linked dymanically and libtorrent.pyd statically if it makes any difference, I have no clue.
Thank you for your thoughts, mhertz. I'll keep looking; something's wrong with my environment.
PhiliP
Member
Member
Posts: 33
Joined: Sun Mar 04, 2018 7:36 am

Re: [Unofficial] Deluge 2.0.x installer.

Post by PhiliP »

@ mhertz

Hello. Thank you for your hard word and all the ones whom making 2.0 realable.

I would like to know,...

I do not know if i have to care about the version you give for the label plus pluggin.

There are 3.

If i install you're beta version of your "unofical" deluge installer, witch one should i choose please ?
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Unofficial] Deluge 2.0.x installer.

Post by mhertz »

You're welcome of-course :)

This one: https://github.com/bdutro/deluge-labelp ... -py3.7.egg

@all, I completely forgot, when I stated everything was newest version I believed, that the python used wasent the newest version. I just didn't think of python at all, at the time I stated it, for some reason(though of-course know which python version I use, obviously). I didn't use newest because had issues with gvsbuild, but now that I have figured it out, then I'm messing around seeing if I can change to py3.8 latest version, but will take little time, e.g gvsbuild needs patching which I'm mostly finished with and waiting on answer to new ticket I posted there for a final issue lingering(pycairo/pygobject py38 building issue there). Then I hope the three libtorrent versions I need rebuilding using py3.8 doesn't give me too much trouble. I can tell though I need changing a patch I use for libtorrent 1.1.x, but if that is the only stumbling-block then no biggie. Note, the python I use now, is just about 2 weeks old or so, and supported still, but would like latest py3.8 still, instead of latest py3.7(both is continually updated/supported, like with libtorrent 1.1.x and 1.2.x, same deal).
Last edited by mhertz on Tue Apr 07, 2020 1:10 am, edited 1 time in total.
agapa
New User
New User
Posts: 5
Joined: Sun Mar 29, 2020 8:11 pm

Re: [Unofficial] Deluge 2.0.x installer.

Post by agapa »

mhertz, just to let you know that I recompiled libtorrent with Python 3.7.7 (64-bit, latest 3.7), and now libtorrent works. I have a whole mess of Python versions, so I'll clean them off and try again with Python 3.8. Hope you'll have everything fine with your rebuild. Good luck!

Code: Select all

>dumpbin /dependents libtorrent.pyd
Dump of file libtorrent.pyd
File Type: DLL
  Image has the following dependencies:
    python37.dll
    libcrypto-1_1-x64.dll
    libssl-1_1-x64.dll
    IPHLPAPI.DLL
    WS2_32.dll
    WSOCK32.dll
    KERNEL32.dll

Code: Select all

>python -c "import libtorrent; print(libtorrent.__version__);"
1.2.5.0
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Unofficial] Deluge 2.0.x installer.

Post by mhertz »

Thanks mate, appreciate the feedback and good-luck wishing :)

I'm as stated soon gonna try rebuild libtorrent using py382(mostly msvc c++ of-course, but regardless, still some pyc compilations etc) and will let you know if I find out how to work it out. I have exact same issue as you on building pycairo. It builds without error, but errors out when trying import it. With py377, no issues at all. I know py38 needs you to add dll search path manually now, but everything is already in the pyd for case of libtorrent, so don't understand why fails import, but I'm looking into it, and for pycairo have a ticket on gvsbuild and posted in pycairo upstream ticket made by Djlegolas, a deluge dev, having same issue. Granted, I believe you could still build with one python version and use anyway in another, e.g pyc files are recompiled when built using other py version I read, but still wanna nail this regardless and stick to using only one python version if possible, though I'm too wondering if the need for manual search path of py38 would break this deluge installer, atleast without code changes, but we'll see soon I guess.

However if I do make the change then people would need rename all there used third-party plugins to have py38 instead of py37 in egg filenames, and when installing new plugin which don't have py38 version, as some don't, then they need to rename them too, though this is also what is needed elsewhere using deluge with py38, like on arch-linux etc.
PhiliP
Member
Member
Posts: 33
Joined: Sun Mar 04, 2018 7:36 am

Re: [Unofficial] Deluge 2.0.x installer.

Post by PhiliP »

@ Mhertz.

I don't know if i'm at the right place but i think you're the most helpfull (at least you're the head of the iceberg) personn at the moment for this project (for windows at least) because it seems to work for me in a virtual machine with W10 full updated and you gave an easy way to install it for newbies like me :).

PS Label plus works too like a charm.

So i send a request that you may or may not can answer. But as you are coding, maybe...

So, i would like to have, in mesure that when i delete a torrent file (in deluge) i always (always) delete the corresponding data file, i wish i can leave the checkbox "delete with data file" always checked by delfault.

Would it be easy ?

As i'm happy to see you're working hard for this project, i could offer an interested contribution. I'm french and if you want me to translate deluge in English to french... i'll be there.

Philippe
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Unofficial] Deluge 2.0.x installer.

Post by mhertz »

Thanks for the kind words, much appreciated, though too kind, but regardless :)

I mostly only can do fixes if they are really easy honestly, and even then, not always possible for me regardless, but your request seem doable. However I don't wanna try to add that into deluge from e.g. one or two new added core.conf options, and add a few conditionals in-place, as don't wanna make unofficial changes to deluge, except when absolutely neccesary, so these changes you're after will then be overridden on updates mind you and will need reapplied.

Anyway, from looking at the code, I see two easy possibilities, one for always having that checkbox ticked(delete_files), though not that usefull honestly, because in deluge by default there already is made so that if you hold shift down and press delete on one or more torrents, then the box also is checked, but only when using delete button together with shift as shift + remove context-menu doesn't work however. My fix would save you from needing to use shift though, and work both from mouse(context-menu) and del key.

Next option is that if you always wanting to have that ticked, and use that option, and if you're not affraid of screw-ups(unintended wrong key pressed or menu selected), then why not save some time/clicks and completely bypass the remove torrent gtk-dialog and just have it delete the torrent(s) with data included right away. Works either from delete button or remove context-menu and for several torrents at a time, but again, beware of screw-ups ;)

Anyway, instead of I posting files for you to overwrite under a long path of deluge sub-folders, or patches for you to apply,then I thought it would be easier for you to just run an exe, so I made two different exe's, which just are 7z-sfx silent/unattended installers with a batchfile and a windows version of gnu patch and a patch, one for option 1 and another for option 2, which are around 1mb each and fully cleans up after themselves. Again you will have to run after each update again, and make a choise at first which to use, because you cannot run one after the other in this initial version atleast, though should be easy to add(also maybe I should use sed instead of patch possibly).

The exe's asume you use default install-dir suggested by installer, but if you don't then I can change it so they ask you for a folder where you have installed deluge and then runs the patching thereafter. As default install location needs admin rights to mess with, then I added an UAC prompt to come up and ask you to press OK to run as admin.

There will be nothing shown or displayed when run, so after a second or two then it's applied and you can start deluge again or whatever. Maybe I should have added a dialog stating patching finished and for you to press OK to exit, but didn't thought off that at the time, but I can add it if you prefer such. I hate added clicks and such myself, and like being able to script/automate stuff, so always makes things like these completely silent/unattended, as per my own old habits.

Patch.exe (auto-enable delete_files checkbox always) :
http://s000.tinyupload.com/index.php?fi ... 9970586210

Patch-2.exe (bypass remove-torrent gtk-dialog and always just remove torrent + data) :
http://s000.tinyupload.com/index.php?fi ... 9381676436

Thank you for offering to make french translations, that's nice of you, but I don't think you need to do that, since I see there already are french translation, last edited by Cas in 2017, but thanks again for the thought. Before I changed recently to US locale in my windows VM(which I much prefer honestly e.g for searching options, logfiles and seems just more normal to me), then translations only came through sometimes and not always I noticed, but I don't know why that is or how to fix though unfortunetly.

Hope it helps you a little :)
PhiliP
Member
Member
Posts: 33
Joined: Sun Mar 04, 2018 7:36 am

Re: [Unofficial] Deluge 2.0.x installer.

Post by PhiliP »

@mhertz

Thank you, that's a nice help :).

I'll choose second patch.

For my language, i've enabled it in deluge but it doesn't work. That's not a huge proble but that's weird because it was working on the prior version.

Take care ;
Post Reply