hyperliquid-dex / hyperliquid-python-sdk

SDK for Hyperliquid API trading with Python.
MIT License
238 stars 97 forks source link

python version 3.12 produces error on first run, not mentioned on pypi #50

Open basRet opened 2 months ago

basRet commented 2 months ago

It seems like python 3.12 is not fully compatible with this rep, even though this is not mentioned on pip. If I do the same thing but replace the venv with 3.10 and then afterwards try to run with 3.12 it will work just fine. However, running this with python 3.12 for the first time will produce errors with some libraries that this rep needs. This makes it difficult for new people to join, since this is not mentioned on the pypi version requirements or in the documentation.

How to reproduce:

  1. start a new venv with python 3.12.3
  2. install hyperliquid-python-sdk (version 0.6.0) with pip
  3. create open_order.py with text from the example
  4. create example_utils.py with text from example
  5. create config.json with appropriate info
  6. run open_order.py
error: Traceback (most recent call last):
  File "pythonProject\trial.py", line 4, in <module>
    import example_utils
  File "pythonProject\example_utils.py", line 1, in <module>
    import eth_account
  File "pythonProject\.venv\Lib\site-packages\eth_account\__init__.py", line 1, in <module>
    from eth_account.account import (
  File "pythonProject\.venv\Lib\site-packages\eth_account\account.py", line 18, in <module>
    from eth_keyfile import (
  File "pythonProject\.venv\Lib\site-packages\eth_keyfile\__init__.py", line 3, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
Nishan-Pradhan commented 2 months ago

+1

thegoof commented 1 month ago

I'm a python noob and this is certainly giving me grief 😂 been several evenings so far trying to deploy my app to a sad face only 😭🤣 It would be great if this could be managed soon please by those with superior knowledge 🫡❤️

laurenz-k commented 1 month ago

eth-account 0.8.0 version seems responsible.

Disloxic commented 1 week ago

When can we expect the migration from the deprecated 'pkg_resources' to the new method: 'importlib_resources' in the project files?