Python-binance: ImportError: No module named 'binance'

Created on 9 Aug 2018  路  6Comments  路  Source: sammchardy/python-binance

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.

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 SomePackage to make sure you don't have multiple versions of pip messing it up

All 6 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bilgecetin picture bilgecetin  路  6Comments

terenceljz picture terenceljz  路  3Comments

.
Rob-bb picture Rob-bb  路  6Comments

marzwu picture marzwu  路  4Comments

iamveritas picture iamveritas  路  3Comments