试图运行包含python-binance
和OpenSSL
模块的python3代码在cryptography
包中的导入失败。以下是错误的部分堆栈跟踪:
File "/usr/lib/python3/dist-packages/cryptography/x509/base.py", line 15, in <module>
from cryptography.x509.extensions import Extension, ExtensionType
File "/usr/lib/python3/dist-packages/cryptography/x509/extensions.py", line 19, in <module>
from cryptography.hazmat.primitives import constant_time, serialization
File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/constant_time.py", line 9, in <module>
from cryptography.hazmat.bindings._constant_time import lib
ModuleNotFoundError: No module named 'cryptography.hazmat.bindings._constant_time'
我的解决方案是升级加密包:
pip3 install upgrade cryptography
我还验证了所需系统包的安装:
sudo apt install build-essential libssl-dev libffi-dev python3-dev
相关问题 更多 >
编程相关推荐