binance / binance-public-data

Details on how to get Binance public data
1.4k stars 444 forks source link

Problem getting "Cllient" #317

Closed JoseBarros23 closed 3 months ago

JoseBarros23 commented 4 months ago

Hello

I'm trying to run this: `from binance.spot import Spot #Volví a obtener lo de RestrictedLocation

client = Spot() print(client.time())

client = Spot(key=api_key, secret= api_secret)

Get account information

print(client.account())`

But I'm getting this error:

`ypeError Traceback (most recent call last) Cell In[11], line 6 3 client = Spot() 4 print(client.time()) ----> 6 client = Spot(key=api_key, secret= api_secret) 8 # Get account information 9 print(client.account())

File c:\Users\JOSE\AppData\Local\Programs\Python\Python311\Lib\site-packages\binance\spot__init__.py:8, in Spot.init(self, api_key, api_secret, kwargs) 6 if "base_url" not in kwargs: 7 kwargs["base_url"] = "https://api.binance.com/" ----> 8 super().init(api_key, api_secret, kwargs)

TypeError: API.init() got an unexpected keyword argument 'key'`

What should I do?

aisling-2 commented 3 months ago

I don't think you're using code from this repository.

However to solve your issue, you need to see what .../site-packages\binance\spot/_init_.py is expecting as argument keyword/name, it's not key, probably api_key. Ref: https://github.com/binance/binance-connector-python/blob/master/binance/spot/__init__.py