Forums

ModuleNotFoundError: No module named 'binance'

I ran this file containing: from binance.client import Client but the output was

Traceback (most recent call last): File "/home/joszmena/.virtualenvs/myvirtualenv/bot.py", line 1, in <module> from binance.client import Client ModuleNotFoundError: No module named 'binance'

and i have installed binance lib in my virtualenv. I don't know what's wrong

How are you running the code -- is it in a console, from a website's code, or something else? How did you activate the virtualenv?

I opened the file bot.py stored in my virtualenv and I clicked the run button at the top right corner in pythonsnwhere website

Thanks for the details! You'll need to put something at the top of your file to tell the run button that it should use the virtualenv to run the script -- see the section at the bottom of this help page.

Thanks. It runs fine now.

Excellent, thanks for confirming!