加密包导入失败

2024-05-08 00:31:39 发布

您现在位置:Python中文网/ 问答频道 /正文

试图运行包含python-binanceOpenSSL模块的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'

Tags: inpytimelibpackagesusrdistline