Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ModuleNotFoundError: No module named 'libtorrent'

I tried to run this below code in google colabratory:

!apt install python3-libtorrent

import libtorrent as lt

I was able to install python3-libtorrent. But am unable to import libtorrent. But the import attempt above gave a

ModuleNotFoundError: No module named 'libtorrent'
like image 632
Alsayer Avatar asked Feb 25 '21 03:02

Alsayer


2 Answers

Paste these two lines before the first line in the code.

!python -m pip install --upgrade pip setuptools wheel
!python -m pip install lbry-libtorrent
like image 70
user8524786 Avatar answered Nov 13 '22 10:11

user8524786


!python -m pip install lbry-libtorrent
!apt install python3-libtorrent
 
import libtorrent as lt
 
ses = lt.session()
ses.listen_on(6881, 6891)
downloads = []

No need ;) !python -m pip install --upgrade pip setuptools wheel

like image 38
Richard Avatar answered Nov 13 '22 08:11

Richard