Pip错误:“模块"对象没有属性"Cryptography_HAS_SSL_ST" [英] Pip Error : 'module' object has no attribute 'Cryptography_HAS_SSL_ST'

查看:88
本文介绍了Pip错误:“模块"对象没有属性"Cryptography_HAS_SSL_ST"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试从pip安装并继续出现类似类型的错误.

I tried to install from pip and keep on getting similar type of errors.

$ pip install quandl
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 558, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2355, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2361, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 22, in <module>
    import requests, six
  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 53, in <module>
    import OpenSSL.SSL
  File "/home/ubuntu/.local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/home/ubuntu/.local/lib/python2.7/site-packages/OpenSSL/SSL.py", line 112, in <module>
    if _lib.Cryptography_HAS_SSL_ST:
AttributeError: 'module' object has no attribute 'Cryptography_HAS_SSL_ST'

现在即使我尝试安装不同的pip模块也遇到相同的错误,对此是否有解决方案?这是由于在下载pip模块时意外终止进程造成的.

Now even though i tried to install different pip modules iam getting same error.Is there any solution for this ? This was caused due to the unexpected killing of the process while a pip module is being downloaded.

请帮助我采取必要的步骤来纠正此错误.

Please help me with the necessary steps to rectify this error.

我尝试安装此

$ pip install -U cryptography
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 558, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2355, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2361, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 22, in <module>
    import requests, six
  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 53, in <module>
    import OpenSSL.SSL
  File "/home/ubuntu/.local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/home/ubuntu/.local/lib/python2.7/site-packages/OpenSSL/SSL.py", line 112, in <module>
    if _lib.Cryptography_HAS_SSL_ST:
AttributeError: 'module' object has no attribute 'Cryptography_HAS_SSL_ST'

推荐答案

Ubuntu 16.04.3此处:

Ubuntu 16.04.3 here:

我想我已经通过以下方式删除了python-openssl软件包(及其依赖项)来解决此问题:

I think I have fixed this by removing the python-openssl package (and it's dependencies) with:

apt-get --auto-remove remove python-openssl

然后使用pip安装最新版本:

Then installing the latest version with pip:

pip install pyOpenSSL

当然,如果您安装了另一个依赖于它的apt软件包,它将把它重新拉回.我希望如果从现在开始使用pip代替apt,那应该没问题.

Of course, if you install another apt package that depends on it, it'll pull it back in. I hope if you use pip for everything you can from now on instead of apt, it should be fine.

截至2019年1月,此问题似乎不再存在.

as of January 2019 this issue doesn't seem to exist any more.

这篇关于Pip错误:“模块"对象没有属性"Cryptography_HAS_SSL_ST"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆