sammchardy / python-binance

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

ModuleNotFoundError: No module named 'binance.websockets' #819

Open effective-ai opened 3 years ago

effective-ai commented 3 years ago

Describe the bug ModuleNotFoundError: No module named 'binance.websockets'

To Reproduce from binance.websockets import BinanceSocketManager

Environment (please complete the following information):

Package Version


aiohttp 3.7.4.post0 argon2-cffi 20.1.0 async-generator 1.10 async-timeout 3.0.1 attrs 20.2.0 backcall 0.2.0 bleach 3.2.1 brotlipy 0.7.0 certifi 2020.6.20 cffi 1.14.3 chardet 3.0.4 convertdate 2.3.2 cryptography 3.1.1 cycler 0.10.0 Cython 0.29.21 dateparser 1.0.0 decorator 4.4.2 defusedxml 0.6.0 entrypoints 0.3 ephem 3.7.7.1 fbprophet 0.7.1 hijri-converter 2.1.1 holidays 0.11.1 idna 2.10 importlib-metadata 2.0.0 ipykernel 5.3.4 ipython 7.18.1 ipython-genutils 0.2.0 ipywidgets 7.5.1 jedi 0.17.2 Jinja2 2.11.2 joblib 0.17.0 json5 0.9.5 jsonschema 3.2.0 jupyter-client 6.1.7 jupyter-core 4.6.3 jupyterlab 2.2.6 jupyterlab-pygments 0.1.2 jupyterlab-server 1.2.0 kiwisolver 1.2.0 korean-lunar-calendar 0.2.1 llvmlite 0.36.0 LunarCalendar 0.0.9 lxml 4.6.1 MarkupSafe 1.1.1 matplotlib 3.3.1 mistune 0.8.4 mkl-fft 1.2.0 mkl-random 1.1.0 mkl-service 2.3.0 multidict 5.1.0 multitasking 0.0.9 nbclient 0.5.1 nbconvert 6.0.7 nbformat 5.0.8 nest-asyncio 1.4.1 notebook 6.1.4 numba 0.53.1 numpy 1.19.1 olefile 0.46 opencv-python 4.5.1.48 packaging 20.4 pandas 1.1.3 pandocfilters 1.4.2 parso 0.7.0 pathlib 1.0.1 pexpect 4.8.0 pickleshare 0.7.5 Pillow 8.0.0 pip 20.2.4 plotly 4.14.3 prometheus-client 0.8.0 prompt-toolkit 3.0.8 psutil 5.8.0 ptyprocess 0.6.0 pycparser 2.20 pydot 1.4.2 pydotplus 2.0.2 Pygments 2.7.1 PyMeeus 0.5.10 pyOpenSSL 19.1.0 pyparsing 2.4.7 pyrsistent 0.17.3 PySocks 1.7.1 pystan 2.18.0.0 python-binance 1.0.4 python-dateutil 2.8.1 python-decouple 3.4 pytz 2020.1 pyzmq 19.0.2 regex 2021.4.4 requests 2.25.1 retrying 1.3.3 scikit-learn 0.23.2 scipy 1.5.2 seaborn 0.11.0 Send2Trash 1.5.0 setuptools 50.3.0.post20201006 sip 4.19.24 six 1.15.0 terminado 0.9.1 testpath 0.4.4 threadpoolctl 2.1.0 tornado 6.0.4 tqdm 4.50.2 traitlets 5.0.5 typing-extensions 3.10.0.0 tzlocal 2.1 ujson 4.0.2 urllib3 1.25.11 wcwidth 0.2.5 webencodings 0.5.1 websockets 9.0.1 wheel 0.35.1 widgetsnbextension 3.5.1 yarl 1.6.3 yfinance 0.1.59 zipp 3.3.1

ipxs123 commented 3 years ago

same problem, Untitled

hoangdh5 commented 3 years ago

I get the same error and found that the package was changed and websocket was not in the package any more. Try the new version of python-binance

ipxs123 commented 3 years ago

I get the same error and found that the package was changed and websocket was not in the package any more. Try the new version of python-binance

wtf? dude check my uploaded photo , it is in the right directory

Zakariaair commented 3 years ago

I think you should change your code like this: from binance.streams import BinanceSocketManager

ipxs123 commented 3 years ago

then ModuleNotFoundError: No module named 'binance.streams

PS C:\Users\atmos\OneDrive\Desktop\PumpBot-master> & C:/Users/atmos/AppData/Local/Programs/Python/Python39/python.exe c:/Users/atmos/OneDrive/Desktop/PumpBot-master/PumpBot.py Traceback (most recent call last): File "c:\Users\atmos\OneDrive\Desktop\PumpBot-master\PumpBot.py", line 4, in from binance.streams import BinanceSocketManager ModuleNotFoundError: No module named 'binance.streams' PS C:\Users\atmos\OneDrive\Desktop\PumpBot-master>

PiyushDixit96 commented 3 years ago

latest update some function or method name changed, if you want to use your old , please downgrade it, or update code to latest one method. downgrade pip3 install python-binance==0.7.9

LaDice commented 2 years ago

you just need the python-binance version 0.7.3 To do the python version 0.7.3, Go to your terminal and type pip install --upgrade python-binance==0.7.3 I hope I helped you (leave the code as it is)

ka3uskama commented 1 year ago

that works for me. Thanks! But it works as slow as //// Idk why, maybe its not the most optimal way to connect bnnc web-sockets