Kucoin / kucoin-python-sdk

MIT License
46 stars 16 forks source link

ImportError: cannot import name 'Trade' from 'kucoin.client' #73

Closed BaseMax closed 2 years ago

BaseMax commented 2 years ago
from kucoin.client import Trade

C:\Users\MAX\Documents>python trade.py

Traceback (most recent call last):
  File "C:\Users\MAX\Documents\trade.py", line 1, in <module>
    from kucoin.client import Trade
ImportError: cannot import name 'Trade' from 'kucoin.client' (C:\Users\MAX\AppData\Local\Programs\Python\Python310\lib\site-packages\kucoin\client.py)
codewc commented 2 years ago

from kucoin.client import Trade

Hi, you should install the SDK first pip install kucoin-python then please check if the installed environment is the one you are using

BaseMax commented 2 years ago

python -m pip install kucoin-python

Collecting kucoin-python
  Downloading kucoin_python-1.0.11-py3-none-any.whl (21 kB)
Requirement already satisfied: websockets in c:\users\max\appdata\local\programs\python\python310\lib\site-packages (from kucoin-python) (10.3)
Requirement already satisfied: requests in c:\users\max\appdata\local\programs\python\python310\lib\site-packages (from kucoin-python) (2.27.1)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\max\appdata\local\programs\python\python310\lib\site-packages (from requests->kucoin-python) (2022.5.18.1)
Requirement already satisfied: idna<4,>=2.5 in c:\users\max\appdata\local\programs\python\python310\lib\site-packages (from requests->kucoin-python) (3.3)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\max\appdata\local\programs\python\python310\lib\site-packages (from requests->kucoin-python) (2.0.12)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\max\appdata\local\programs\python\python310\lib\site-packages (from requests->kucoin-python) (1.26.9)
Installing collected packages: kucoin-python
Successfully installed kucoin-python-1.0.11

It seems solved. I will test more deeply...

Thank you.

BaseMax commented 2 years ago

Thank you, the problem fixed.