ModuleNotFoundError:ubuntu 22.04 中没有名为“cryptography.hazmat.backends.openssl.x509”的模块

ModuleNotFoundError:ubuntu 22.04 中没有名为“cryptography.hazmat.backends.openssl.x509”的模块

在安装 Apache 超集时,请按照以下链接中的说明进行操作

https://asd.learnlearn.in/apache-superset-ubuntu-22/

我们收到如下所示的错误:

(venv) skt@admin:~$ superset fab create-admin
Traceback (most recent call last):
  File "/home/st/venv/bin/superset", line 33, in <module>
    sys.exit(load_entry_point('apache-superset==1.5.1', 'console_scripts', 'superset')())
  File "/home/st/venv/bin/superset", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/st/venv/lib/python3.8/site-packages/superset/__init__.py", line 21, in <module>
    from superset.app import create_app
  File "/home/st/venv/lib/python3.8/site-packages/superset/app.py", line 23, in <module>
    from superset.initialization import SupersetAppInitializer
  File "/home/st/venv/lib/python3.8/site-packages/superset/initialization/__init__.py", line 51, in <module>
    from superset.security import SupersetSecurityManager
  File "/home/st/venv/lib/python3.8/site-packages/superset/security/__init__.py", line 17, in <module>
    from superset.security.manager import SupersetSecurityManager  # noqa: F401
  File "/home/st/venv/lib/python3.8/site-packages/superset/security/manager.py", line 76, in <module>
    from superset.utils.core import DatasourceName, RowLevelSecurityFilterType
  File "/home/st/venv/lib/python3.8/site-packages/superset/utils/core.py", line 74, in <module>
    from cryptography.hazmat.backends.openssl.x509 import _Certificate
ModuleNotFoundError: No module named 'cryptography.hazmat.backends.openssl.x509'

请帮助解决问题以完成 Apache 超集安装。

答案1

遇到过类似的问题。执行了以下步骤,成功了。

将 cryptography 降级至 38.0.2 将 Flask 降级至 2.1.0 将 Werkzeug 降级至 2.0.0

相关内容