sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
6.02k stars 2.2k forks source link

ImportError: cannot import name 'Client' #116

Closed queezyy closed 6 years ago

queezyy commented 6 years ago

In my screenshot below you can see i successfully installed python-binance (via pip), but when i run my script, it is not recognizing your module. I am using "from binance.client import Client" python-binance error

iero commented 6 years ago

Missing those lines in init.py file

from binance import client from binance import depthcache from binance import enums from binance import exceptions from binance import websockets

queezyy commented 6 years ago

Thanks for the response. I added those lines to \Lib\site-packages\binance\_init__.py, but still not working. Also, __init_\.py in the code base on this site is blank. Why wouldn't he include those lines in the base code? Most modules run fine after a pip install, not seeing why an ini file would need updating. It's also not in his instructions.

queezyy commented 6 years ago

I am starting to think it is because i had another Python Binance wrapper installed. https://github.com/cnfuyu/python-binance-api

I am going to work to make sure this module is completely removed and then re-install Sams.

sammchardy commented 6 years ago

Hi @queezyy if you can it may help to use a python environment like virtualenv to install packages into. This keeps things separated, you will run into issues like this if you start to install packages globally.

These links may help, it's much simpler in a Linux env http://timmyreilly.azurewebsites.net/setup-a-virtualenv-for-python-3-on-windows/ http://timmyreilly.azurewebsites.net/python-pip-virtualenv-installation-on-windows/

boctulus commented 3 years ago

Same problem here !! It suddently failed

lyongh commented 3 years ago

update your pip and install python-binanece again,it will done.

JIClaveria097 commented 2 years ago

from binance import * api_key = 'you_key' api_secret = 'you_key' client = set(api_key,api_secret)

this work for me

RBouhl commented 2 years ago

client = set(api_key,api_secret)

this work for me

Does it ?

    client = set(api_key, api_secret)
TypeError: set expected at most 1 argument, got 2
kroksys commented 2 years ago

For me the issue was fixed when I renamed local binance.py file to something else .py