ModuleNotFoundError: No module named 'libtorrent'

Alsayer picture Alsayer · Feb 25, 2021 · Viewed 7.7k times · Source

I tried to run this below code in google colabratory :

!apt install python3-libtorrent

import libtorrent as lt
ses = lt.session()
ses.listen_on(6881, 6891)
downloads = []

I was able to install python3-libtorrent. But am being unable import libtorrent. It was showing ModuleNotFoundError: No module named 'libtorrent'. It was showing the second code was wrong which is "import libtorrent as lt" Any suggestion would be appreciated

Answer

user8524786 picture user8524786 · Feb 25, 2021

Paste these two lines before the first line.

   !python -m pip install --upgrade pip setuptools wheel
   !python -m pip install lbry-libtorrent