回溯错误 virt-manager:“module”对象没有属性“SSL_ST_INIT”

回溯错误 virt-manager:“module”对象没有属性“SSL_ST_INIT”

我无法在 Ubuntu 16.04 上运行 virt-manager 或 virt-install。每次我尝试时都会出现 python 错误:

➜  / $ virt-manager                      
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager", line 34, in <module>
    from virtinst import util as util
  File "/usr/share/virt-manager/virtinst/__init__.py", line 87, in <module>
    from virtinst.distroinstaller import DistroInstaller
  File "/usr/share/virt-manager/virtinst/distroinstaller.py", line 26, in <module>
    from . import urlfetcher
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 27, in <module>
    import requests
  File "/usr/lib/python2.7/dist-packages/requests/__init__.py", line 53, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/usr/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 54, in <module>
    import OpenSSL.SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in <module>
    SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

--

➜  / $ virt-install                      
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-install", line 28, in <module>
    import virtinst
  File "/usr/share/virt-manager/virtinst/__init__.py", line 87, in <module>
    from virtinst.distroinstaller import DistroInstaller
  File "/usr/share/virt-manager/virtinst/distroinstaller.py", line 26, in <module>
    from . import urlfetcher
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 27, in <module>
    import requests
  File "/usr/lib/python2.7/dist-packages/requests/__init__.py", line 53, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/usr/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 54, in <module>
    import OpenSSL.SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in <module>
    SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

你能帮助我吗 ?

谢谢

答案1

要解决这个问题 :

sudo apt-get --auto-remove --yes remove python-openssl
sudo pip install --user --upgrade cryptography
sudo pip install pyOpenSSL

我希望这能够帮助到大家!

相关内容