
我正在嘗試使用 torrentp 在 python 中下載 torrent,但它依賴於libtorrent
.
我嘗試運行這段程式碼:
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
但我收到這個錯誤:
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.
我讀過幾篇相關文章libtorrent
,但到目前為止還沒有解決這個問題:
- 重新安裝 Microsoft Visual C++ Redistributable
- 重新安裝
libtorrent
並torrentp
我使用安裝了 libtorrent pip install libtorrent
,並且pip install torrentp
還嘗試從以下位置安裝軟體包github並做
python setup.py build
和
python setup.py install
但我得到這個:
error: [WinError 2] The system cannot find the file specified
都來自build
和install
。