Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After installed binance-futures-connector,binance-connector-python can not work #324

Open
roc1 opened this issue Jun 15, 2024 · 1 comment

Comments

@roc1
Copy link

roc1 commented Jun 15, 2024

install new binance-connector-python(3.7.0)
2.
install binance-futures-connector(4.0.0)
3.
Run below code:

`from binance.websocket.spot.websocket_api import SpotWebsocketAPIClient

def message_handler(_, message):
logging.info(message)

proxies = { 'http': 'http://1.2.3.4:8080' }

my_client = SpotWebsocketAPIClient(on_message=message_handler, proxies=proxies, timeout=10)

my_client.ticker(symbol="OPUSDT", type="FULL")

time.sleep(5)
logging.info("closing ws connection")
my_client.stop()`

Error:
Traceback (most recent call last):
File "E:\xx.py", line 10, in
from binance.websocket.spot.websocket_api import SpotWebsocketAPIClient
File "E:\xxx\venv\Lib\site-packages\binance\websocket\spot\websocket_api_init_.py", line 6, in
class SpotWebsocketAPIClient(BinanceWebsocketClient):
File "E:\xxx\venv\Lib\site-packages\binance\websocket\spot\websocket_api_init_.py", line 39, in SpotWebsocketAPIClient
from binance.websocket.spot.websocket_api._market import ping_connectivity
File "E:\xxx\venv\Lib\site-packages\binance\websocket\spot\websocket_api_market.py", line 1, in
from binance.lib.utils import get_uuid, purge_map
ImportError: cannot import name 'get_uuid' from 'binance.lib.utils' (E:\xxx\venv\Lib\site-packages\binance\lib\utils.py)


futures-connector rewrite utils.py file?

@roc1 roc1 changed the title 安装binance-futures-connector后,websocket client不能运行 an'zhuang'zhuangbinance-futures-connector后,SpotWebsocketStreamClient不能运行 Jun 15, 2024
@roc1 roc1 changed the title an'zhuang'zhuangbinance-futures-connector后,SpotWebsocketStreamClient不能运行 安装binance-futures-connector后,SpotWebsocketStreamClient不能运行 Jun 15, 2024
@roc1 roc1 changed the title 安装binance-futures-connector后,SpotWebsocketStreamClient不能运行 After installed binance-futures-connector,SpotWebsocketStreamClient can't run Jun 15, 2024
@roc1 roc1 changed the title After installed binance-futures-connector,SpotWebsocketStreamClient can't run After installed binance-futures-connector,SpotWebsocketAPIClient can't run Jun 15, 2024
@roc1 roc1 changed the title After installed binance-futures-connector,SpotWebsocketAPIClient can't run After installed binance-futures-connector,binance-connector-python can not work Jun 17, 2024
@chris-anjost
Copy link

The problem is that both dependencies share the same package name i.e. binance.

A quick fix is to change the order of installation:

  1. Remove both packages
  2. Install binance-futures-connector
  3. Install binance-connector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants