Hi Guys,
Trying to get passed an import error. I have seen similar import error being reported that seem to stem from conflicting files/directories in the path, however I believe the error is something different.
I initially tried doing
from binance.client import Client
which threw the ImportError: No module named 'binance'. This file was nestled a few directories deep, but i did not name any files or directories 'binance'. I then decided to create a blank file at the root of the directory and try to run
import binance
This attempt also threw the same error
ImportError: No module named 'binance
I am struggling to find the issue now, I have tried to install 'python-binance' and 'python-binance-api' individually with pip and still i have this issue. I am running on Ubuntu 16.04.5.
Thanks.
Are you using python 2 or 3, if so you might just need to do pip3 install python-binance
or just do python -m pip install SomePackage to make sure you don't have multiple versions of pip messing it up
try sudo -H pip install python-binance. (on python 2.x)
or sudo -H pip3 install python-binance (on python 3.x)
Thanks @K-Kit , doing python -m pip install SomePackage works in my case.
@priyakumariengineer Was this by any chance because you had anaconda running elsewhere?
i suppose installing thru pip is unrelated to library itself. closing.
I had a similar issue, for me the problem was my IDE was trying to run the code in a different version of python than that of the library. Running manually from terminal python3 bot.py worked
Most helpful comment
Are you using python 2 or 3, if so you might just need to do pip3 install python-binance
or just do
python -m pip install SomePackageto make sure you don't have multiple versions of pip messing it up