ModuleNotFoundError: No module named 'binance'

See original GitHub issue

Trying to access the binance API.

from binance.client import client client = client(api_key, api_secret)

But I get this error :

D:\Users\username\Desktop\pyproject>get_data.py Traceback (most recent call last): File “D:\Users\username\Desktop\pyproject\get_data.py”, line 1, in <module> from binance.client import client ModuleNotFoundError: No module named ‘binance’

Everything was installed as expected. Using pip install python-binance command

There is a binance directory in …\site-packages\

System paths for python using import sys sys.path are : [‘’, ‘D:\Users\username\AppData\Local\Programs\Python\Python38\python38.zip’, ‘D:\Users\username\AppData\Local\Programs\Python\Python38\DLLs’, ‘D:\Users\username\AppData\Local\Programs\Python\Python38\lib’, ‘D:\Users\username\AppData\Local\Programs\Python\Python38’, ‘D:\Users\username\AppData\Local\Programs\Python\Python38\lib\site-packages’, ‘D:\Users\username\AppData\Local\Programs\Python\Python38\lib\site-packages\win32’, ‘D:\Users\username\AppData\Local\Programs\Python\Python38\lib\site-packages\win32\lib’, ‘D:\Users\username\AppData\Local\Programs\Python\Python38\lib\site-packages\Pythonwin’]

I have tried everything.

Please help ! Thank you

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
RustyBadRobotcommented, Jan 13, 2021

I had the exact same issue today, hopefully this will help you too. I realised it was because I had named my file binance.py !!! Why do stupid errors take the longest to unpick.

1reaction
uneasyguycommented, Jan 30, 2021

Same problem here on Ubuntu 18.04LTS and Windows 10. When running pip install python-binance, there appears to be an error when installing Twisted:

src/twisted/test/raiser.c:4:10: fatal error: Python.h: No such file or directory
     #include "Python.h"
              ^~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Everything I have found about this error says to install python3-dev and/or python-dev. It didn’t help me but it may help you.

When installing with python3.9 on Ubuntu 20.04.2 LTS I ran into the same error listed here. Steps to resolve were:

sudo apt-get update sudo apt-get upgrade sudo apt install python3.9-dev pip install python-binance

All worked as intended afterwards

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'binance.client ...
From me the solution was simple: somehow there was a binance.py file in the site-packages folder, I just renamed it to something else,...
Read more >
Why am I getting this error 'ModuleNotFoundError: No module ...
This can happen when a directory in your project called "binance". Basically PyCharm will think that you are importing ...
Read more >
ModuleNotFoundError: No module named 'binance.websockets'
Hi. Without the details of your package used, there are two possible reasons. One is that the package is not properly installed in...
Read more >
Problem with binance.client : Forums - PythonAnywhere
"from binance.client import Client ModuleNotFoundError: No module named 'binance.client'; 'binance' is not a package".
Read more >
How to FIX ModuleNotFoundError No module named 'binance ...
How to FIX ModuleNotFoundError No module named ' binance client' 'binance' is not a package python trade binance.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found