17

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'
desertnaut
  • 57,590
  • 26
  • 140
  • 166
Alsayer
  • 171
  • 1
  • 1
  • 5

3 Answers3

31

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
Just Mohit
  • 141
  • 1
  • 13
user8524786
  • 466
  • 5
  • 13
3
!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

Richard
  • 31
  • 2
0

try

!python -m pip install lbry-libtorrent
desertnaut
  • 57,590
  • 26
  • 140
  • 166