quantmew / okex-py

OKEx(okx) Cryptocurrency Exchange python SDK v5 and v3 (Unofficial)
MIT License
64 stars 32 forks source link

无法导入TypeAlias #5

Closed hyanx closed 1 year ago

hyanx commented 1 year ago

无法导入TypeAlias

# python3 example_v5.py 
Traceback (most recent call last):
  File "example_v5.py", line 14, in <module>
    import okex.v5.account_api as account
  File "/usr/local/lib/python3.8/dist-packages/okex/v5/account_api.py", line 10, in <module>
    from .ccytype import CcyType
  File "/usr/local/lib/python3.8/dist-packages/okex/v5/ccytype.py", line 3, in <module>
    from typing import TypeAlias, Union
ImportError: cannot import name 'TypeAlias' from 'typing' (/usr/lib/python3.8/typing.py)

已经安装这个包了:

# pip3 list
Package                Version             
---------------------- --------------------          
typing                 3.7.4.3     

要怎么解决呢?

jstzwj commented 1 year ago

请使用Python 3.10或3.10以上的版本,或者删除代码中的”: TypeAlias“类型注释。