为什么我出现语法错误python-Centos上的pip

时间:2019-05-15 06:51:10

标签: python openssl pip centos pyopenssl

我升级了点子。但是升级后会有一些语法错误。

我尝试安装python 3.x,但未修复。

回溯(最近通话最近一次):

File "/usr/bin/pip", line 7, in <module>
    from pip._internal import main
  File "/usr/lib/python2.6/site-packages/pip/_internal/__init__.py", line 19, in <module>
    from pip._vendor.urllib3.exceptions import DependencyWarning
  File "/usr/lib/python2.6/site-packages/pip/_vendor/urllib3/__init__.py", line 8, in <module>
    from .connectionpool import (
  File "/usr/lib/python2.6/site-packages/pip/_vendor/urllib3/connectionpool.py", line 92
    _blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK}

我尝试安装pyopenssl

---------- UPDATE ----------------

我尝试安装python36u我遇到了一些错误

Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: liblzma.so.5(XZ_5.0)(64bit)
Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: libgdbm_compat.so.4()(64bit)
Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: libgdbm.so.4()(64bit)
Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: libcrypto.so.10(OPENSSL_1.0.2)(64bit)
Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: liblzma.so.5()(64bit)
Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: libffi.so.6()(64bit)
Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: libc.so.6(GLIBC_2.17)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

3 个答案:

答案 0 :(得分:1)

不再支持python2.6,请尝试将您的SYS PATH更改为指向新的python和pip

检查此:Python ENV

或者,您可以使用以下内容:

{{1}}

答案 1 :(得分:0)

使用此链接Change default python version

更改默认python版本

您已经为python2环境安装了pyopenssl。所以先将其卸载。

检查版本:python3.6 -V,pip3 -V等 在安装pyopenssl或任何软件时,请使用pip3。

使用 sudo pip3 install pyopenssl pip3 install pyopenssl , 它将起作用。

答案 2 :(得分:0)

---------- UPDATE ----------------

我尝试安装python36u我遇到了一些错误

Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: liblzma.so.5(XZ_5.0)(64bit)
Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: libgdbm_compat.so.4()(64bit)
Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: libgdbm.so.4()(64bit)
Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: libcrypto.so.10(OPENSSL_1.0.2)(64bit)
Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: liblzma.so.5()(64bit)
Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: libffi.so.6()(64bit)
Error: Package: python36u-libs-3.6.8-1.el7.ius.x86_64 (ius)
           Requires: libc.so.6(GLIBC_2.17)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest