LUCIT-Systems-and-Development / unicorn-binance-websocket-api

A Python SDK by LUCIT to use the Binance Websocket API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, com-coin_futures, us, tr, dex/chain+testnet) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-websocket-api.docs.lucit.tech/
Other
685 stars 165 forks source link

'BinanceWebSocketApiManager' object has no attribute 'set_private_api_config' #141

Closed just-a-normal-human closed 3 years ago

just-a-normal-human commented 3 years ago

Select one:

Environment

Operating System? (include version)

Python Version Requirement

Exact Python Version?

Python 3.7.9

Pip Version?

pip 9.0.3 

Description of your issue

When i run on my computer it all works fine, but when i try to run it on a ec2 server I get this error message. Wasnt set_private_api_config removed?

Traceback (most recent call last):
  File "mainStrat.py", line 87, in <module>
    binance_websocket_api_manager.set_private_api_config(binance_je_api_key, binance_je_api_secret)
AttributeError: 'BinanceWebSocketApiManager' object has no attribute 'set_private_api_config'
oliver-zehentleitner commented 3 years ago

pip 9 is very old, i use pip 20 :) python3 -m pip install --upgrade pip

set_private_api_config() is deprecated and was finally removed in 1.28: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/releases/tag/1.28.0

just-a-normal-human commented 3 years ago

Oops, I upgraded pip on my server. But why does the error occur if it doesn't exist, and how would I go about fixing it?

oliver-zehentleitner commented 3 years ago

To give a solid answer, I would need more information about both systems (where it runs and where it doesn't).

I assume you are using a version before 1.28.0 on the local PC where the method is still present. On your server I assume you already have 1.28.0 installed and get the error because you call a function/method that no longer exists.

What is the new way without ubwa.set_private_api_config(binance_je_api_key, binance_je_api_secret)??

Use the new parameter of create_stream():

 ubwa.create_stream('arr', '!userData', api_key=api_key, api_secret=api_secret)
oliver-zehentleitner commented 3 years ago

I close this,