Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/344.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
新安装后的Python pip错误_Python_Openssl_Pip_Pyopenssl - Fatal编程技术网

新安装后的Python pip错误

新安装后的Python pip错误,python,openssl,pip,pyopenssl,Python,Openssl,Pip,Pyopenssl,在重新安装了python3和pythonpip之后,当我尝试使用pip做任何事情时,我都会遇到这种情况 fran@fran:~$ pip -v Traceback (most recent call last): File "/usr/bin/pip", line 9, in <module> from pip import main File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 13, i

在重新安装了python3和pythonpip之后,当我尝试使用pip做任何事情时,我都会遇到这种情况

fran@fran:~$ pip -v
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 13, in <module>
    from pip.exceptions import InstallationError, CommandError, PipError
  File "/usr/lib/python2.7/dist-packages/pip/exceptions.py", line 6, in <module>
    from pip._vendor.six import iteritems
  File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 64, in <module>
    vendored("cachecontrol")
  File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
    __import__(modulename, globals(), locals(), level=0)
  File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>
  File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
  File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 3, in <module>
  File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/__init__.py", line 53, in <module>
  File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 54, in <module>
  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'
fran@fran:~$pip-v
回溯(最近一次呼叫最后一次):
文件“/usr/bin/pip”,第9行,在
从pip导入主
文件“/usr/lib/python2.7/dist-packages/pip/_-init___;u.py”,第13行,在
从pip.exceptions导入InstallationError、CommandError、PiperError
文件“/usr/lib/python2.7/dist-packages/pip/exceptions.py”,第6行,在
来自pip.\u供应商。六个进口iteritems
文件“/usr/lib/python2.7/dist packages/pip/\u vendor/\uuuu init\uuuuuu.py”,第64行,在
卖方(“缓存控制”)
文件“/usr/lib/python2.7/dist packages/pip/\u vendor/\uuuu init\uuuuuuuu.py”,第36行,以vendored格式显示
__导入(modulename,globals(),locals(),level=0)
文件“/usr/share/python wheels/CacheControl-0.11.5-py2.py3 none any.whl/CacheControl/_init__.py”,第9行,在
文件“/usr/share/python wheels/CacheControl-0.11.5-py2.py3 none any.whl/CacheControl/wrapper.py”,第1行,在
文件“/usr/share/python wheels/CacheControl-0.11.5-py2.py3 none any.whl/CacheControl/adapter.py”,第3行,在
文件“/usr/share/python wheels/requests-2.9.1-py2.py3 none any.whl/requests/_init__.py”,第53行,在
文件“/usr/share/python wheels/urllib3-1.13.1-py2.py3 none any.whl/urllib3/contrib/pyopenssl.py”,第54行,在
文件“/usr/lib/python2.7/dist-packages/OpenSSL/_-init___;.py”,第8行,在
从OpenSSL导入rand、加密、SSL
文件“/usr/lib/python2.7/dist packages/OpenSSL/SSL.py”,第118行,在
SSL_ST_INIT=_lib.SSL_ST_INIT
AttributeError:“模块”对象没有属性“SSL\u ST\u INIT”
我是python新手,完全迷路了。有什么想法吗?

尝试安装(或重新安装)pyOpenSSL:

pip uninstall pyOpenSSL
pip install pyOpenSSL
尝试:

为我解决了这个问题

"/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in <module>
SSL_ST_INIT = _lib.SSL_ST_INIT 
“/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py”,第118行,在
SSL_ST_INIT=_lib.SSL_ST_INIT

您安装了pyOpenSSL吗?可能与否重复,我试图安装paramiko,但出现此错误。另外,在这个问题上尝试了解决方案,对meI不起作用吗?当尝试卸载pyOpenSSLYou时,会出现相同的错误。你在linux/windows/mac下吗?我在linux上,ubuntu上
sudo apt-get purge python-openssl
"/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in <module>
SSL_ST_INIT = _lib.SSL_ST_INIT