2016-03-24 29 views
0

大家。 首先,我的操作系统是RHEL7.2,我使用python3.5。
我想用pip来做我想做的事。然后,在我成功安装pip3之后,我想用pip来安装一些东西,但是它显示我ImportError:无法导入名字'HTTPSHandler'。到yum install openssl-devel网站上的解决方案,但它显示了错误:python3.5 pip ImportError:无法导入名称'HTTPSHandler'

Transaction check error: 
    file /usr/bin/sclient from install of krb5-devel-1.13.2-10.el7.x86_64 conflicts with file from package krb5-server-1.13.2-10.el7.x86_64 
    file /usr/sbin/sserver from install of krb5-devel-1.13.2-10.el7.x86_64 conflicts with file from package krb5-server-1.13.2-10.el7.x86_64 

我解决不了independently.I希望你能帮助me.Thanks。

PS:整个错误信息是:

[[email protected] Downloads]$ pip pip-8.0.2-py2.py3-none-any.whl install 
Traceback (most recent call last): 
    File "/usr/bin/pip", line 9, in <module> 
    load_entry_point('pip==8.1.1', 'console_scripts', 'pip')() 
    File "/usr/local/python3.5/lib/python3.5/site-packages/setuptools-20.3.1-py3.5.egg/pkg_resources/__init__.py", line 549, in load_entry_point 
    File "/usr/local/python3.5/lib/python3.5/site-packages/setuptools-20.3.1-py3.5.egg/pkg_resources/__init__.py", line 2542, in load_entry_point 
    File "/usr/local/python3.5/lib/python3.5/site-packages/setuptools-20.3.1-py3.5.egg/pkg_resources/__init__.py", line 2202, in load 
    File "/usr/local/python3.5/lib/python3.5/site-packages/setuptools-20.3.1-py3.5.egg/pkg_resources/__init__.py", line 2208, in resolve 
    File "/usr/local/python3.5/lib/python3.5/site-packages/pip-8.1.1-py3.5.egg/pip/__init__.py", line 16, in <module> 
    from pip.vcs import git, mercurial, subversion, bazaar # noqa 
    File "/usr/local/python3.5/lib/python3.5/site-packages/pip-8.1.1-py3.5.egg/pip/vcs/subversion.py", line 9, in <module> 
    from pip.index import Link 
    File "/usr/local/python3.5/lib/python3.5/site-packages/pip-8.1.1-py3.5.egg/pip/index.py", line 30, in <module> 
    from pip.wheel import Wheel, wheel_ext 
    File "/usr/local/python3.5/lib/python3.5/site-packages/pip-8.1.1-py3.5.egg/pip/wheel.py", line 39, in <module> 
    from pip._vendor.distlib.scripts import ScriptMaker 
    File "/usr/local/python3.5/lib/python3.5/site-packages/pip-8.1.1-py3.5.egg/pip/_vendor/distlib/scripts.py", line 14, in <module> 
    from .compat import sysconfig, detect_encoding, ZipFile 
    File "/usr/local/python3.5/lib/python3.5/site-packages/pip-8.1.1-py3.5.egg/pip/_vendor/distlib/compat.py", line 66, in <module> 
    from urllib.request import (urlopen, urlretrieve, Request, url2pathname, 
ImportError: cannot import name 'HTTPSHandler' 
+0

这个完整的错误?也可能是您的代码没有正确下载数据? –

+0

我添加了更多有关错误的详细信息。请再阅读一次,谢谢。 –

+0

你是否偶然使用virtualenv?这个问题可以通过重新编译python来解决,因为它使用了新的ssl库 –

回答

-1

我解决我的问题。

  1. 我有这么多的存储库和一个存储库中的一些数据与另一个存储库冲突。所以我遵循第一个建议:我reinstall krb5-server,然后我yum install openssl-devel它运作良好。
  2. 我解决了第一个问题后,我用pip失败了,我按照第二个建议:我重新编译python3.5,问题就解决了。
0

首先检查wheather安装的OpenSSL开发

sudo apt-get install libssl-dev 

yum install openssl-dev -y 

尝试另一种方式重新安装pip3,采取Ubuntu例如

sudo apt-get install python3-setuptools 
sudo easy_install3 pip 

使用setuptools吨o安装pip可能可以解决依赖问题。

我尝试在RHEL

sudo yum install -y python35-setuptools 
sudo easy_install-3.5 pip 
相关问题