bybit-exchange / pybit

Official Python3 API connector for Bybit's HTTP and WebSockets APIs.
Other
423 stars 135 forks source link

ModuleNotFoundError: No module named 'Crypto' since pybit 5.6.0 #167

Closed MasterGeorges67 closed 5 months ago

MasterGeorges67 commented 1 year ago

I tried out today the updated version of pybit (5.6.0) and code is no longer running!

 from pybit.unified_trading import HTTP

File "E:\programming\Project\TradeBot3\env\Lib\site-packages\pybit\unified_trading.py", line 7, in from ._v5_misc import MiscHTTP File "E:\programming\Project\TradeBot3\env\Lib\site-packages\pybit_v5_misc.py", line 1, in from ._http_manager import _V5HTTPManager File "E:\programming\Project\TradeBot3\env\Lib\site-packages\pybit_http_manager.py", line 6, in from Crypto.Hash import SHA256 ModuleNotFoundError: No module named 'Crypto'

I already added the crypto module (by pip), do not change, still error. When I revert to 5.5.0, all is working correct.

What did I missing? Is there some news about this?

CodiPapi commented 1 year ago

I had to install PyCryptoDome myself using pip (even though it is listed in the requirements.txt) https://pycryptodome.readthedocs.io/en/latest/src/installation.html

MasterGeorges67 commented 1 year ago

It is still not working with version 5.6.0! I have installed:

dextertd commented 1 year ago

Sounds like you're not using the packages from the requirements https://github.com/bybit-exchange/pybit/blob/master/requirements.txt

When at the path of pybit, you should do

pip install -r requirements.txt
MasterGeorges67 commented 1 year ago

Sorry to say this again, I did install the required packages: pycryptodome==3.19.0 websocket-client==1.5.0 requests>=2.22.0 My simple code is running with the older version of pybit 5.5.0, whitout any problem! After upgrade pybit to the latest build 5.6.0, I get: File "E:\programming\Project\TradeBot3\env\Lib\site-packages\pybit\unified_trading.py", line 7, in from ._v5_misc import MiscHTTP File "E:\programming\Project\TradeBot3\env\Lib\site-packages\pybit_v5_misc.py", line 1, in from ._http_manager import _V5HTTPManager File "E:\programming\Project\TradeBot3\env\Lib\site-packages\pybit_http_manager.py", line 6, in from Crypto.Hash import SHA256 ModuleNotFoundError: No module named 'Crypto' There must be something wrong. Thanks for you support

Tirzono commented 1 year ago

So the issue here is that pycryptodome is missing in the setup.py. That's what pip looks at when installing pybit. @dextertd, do you want me to create a PR for that?

sjagadee commented 6 months ago

Still not fixed, still getting this issue. For 5.7.0

rodionstepanov commented 6 months ago

@sjagadee

Still not fixed, still getting this issue. For 5.7.0

I had the same problem. Solution:

pip uninstall crypto
pip uninstall pycryptodome
pip install pycryptodome
ngocbae98 commented 3 months ago

@sjagadee

Still not fixed, still getting this issue. For 5.7.0

I had the same problem. Solution:

pip uninstall crypto
pip uninstall pycryptodome
pip install pycryptodome

Thanks, solved