Alsayer
Alsayer

Reputation: 171

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'

Upvotes: 17

Views: 27875

Answers (3)

Tharaka Gamage
Tharaka Gamage

Reputation: 199

try

!python -m pip install lbry-libtorrent

Upvotes: 0

AbdEl-Rahman El-Gharib
AbdEl-Rahman El-Gharib

Reputation: 515

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

Upvotes: 33

Richard
Richard

Reputation: 31

!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

Upvotes: 3

Related Questions