PercivallAkihiko
PercivallAkihiko

Reputation: 107

Libtorrent ImportError in python Windows

I'm trying to download torrent in python using torrentp but it has a dependencies to libtorrent. I tried to run this code

import asyncio
from torrentp import TorrentDownloader
torrent_file = TorrentDownloader("magnet:...", '.')
# Start the download process
asyncio.run(torrent_file.start_download()) # start_download() is a asynchronous method 

But I'm getting this error:

D:\Torrent\Media\Script>python torrent.py
Traceback (most recent call last):
  File "D:\Torrent\Media\Script\torrent.py", line 2, in <module>
    from torrentp import TorrentDownloader
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\site-packages\torrentp\__init__.py", line 6, in <module>
    from .torrent_downloader import TorrentDownloader
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\site-packages\torrentp\torrent_downloader.py", line 4, in <module>
    import libtorrent as lt
ImportError: DLL load failed while importing libtorrent: The specified module could not be found.

I've read several post about libtorrent but so far nothing has fixed it:

  1. Reinstalling Microsoft Visual C++ Redistributable
  2. Reinstall libtorrent and torrentp

I installed libtorrent using pip install libtorrent and pip install torrentp I also tried to install the packages from github and do python setup.py build and python setup.py install but I'm getting this:

error: [WinError 2] The system cannot find the file specified

Both from build and install

Upvotes: -1

Views: 196

Answers (1)

Hamzeh
Hamzeh

Reputation: 311

I recommend checking this package on Github: Torrent-To-Google-Drive-Downloader

Upvotes: 0

Related Questions