sammchardy / python-binance

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

Crash by only importing the library #1101

Open Sladerix opened 2 years ago

Sladerix commented 2 years ago

Only importing the libary using: from binance.client import Client or from binance import Client

causes this error:

Traceback (most recent call last):
  File "/path/to/project/main.py", line 13, in <module>
    from binance.client import Client
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/binance/__init__.py", line 9, in <module>
    from binance.client import Client, AsyncClient  # noqa
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/binance/client.py", line 3, in <module>
    import aiohttp
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import (
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/client.py", line 35, in <module>
    from . import hdrs, http, payload
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/http.py", line 7, in <module>
    from .http_parser import (
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/http_parser.py", line 15, in <module>
    from .helpers import NO_EXTENSIONS, BaseTimerContext
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/helpers.py", line 667, in <module>
    class CeilTimeout(async_timeout.timeout):
TypeError: function() argument 'code' must be code, not str

i think it's related to the version of the dependencies. could it be? i try know changing the aiohttp version.

Sladerix commented 2 years ago

Uhm... i uninstalled aiohttp, reinstalled, and now it seems to work O_o