簡體   English   中英

python3.5 pip ImportError:無法導入名稱“ HTTPSHandler”

[英]python3.5 pip ImportError: cannot import name 'HTTPSHandler'

大家 首先,我的操作系統是RHEL7.2,我使用python3.5。
我想用pip來做我想做的事。然后,在成功安裝pip3之后,我想用pip來做事,但它向我顯示ImportError:無法導入名稱“ HTTPSHandler” 。然后按照網站上的解決方案yum install openssl-devel ,但顯示錯誤:

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

我不能獨立解決它。希望您能幫助我。謝謝。

PS:整個錯誤消息是:

[fen@localhost 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'

首先檢查Wheather安裝openssl-develop

sudo apt-get install libssl-dev

要么

yum install openssl-dev -y 

嘗試另一種方式重新安裝pip3 ,例如Ubuntu

sudo apt-get install python3-setuptools
sudo easy_install3 pip

使用setuptools安裝pip可能可以解決依賴性問題。

RHEL上嘗試

sudo yum install -y python35-setuptools
sudo easy_install-3.5 pip

我解決了我的問題。

  1. 我有很多存儲庫,一個存儲庫中的某些數據與另一個存儲庫沖突。 因此,我遵循第一個建議: reinstall krb5-server ,然后yum install openssl-devel ,它運行良好。
  2. 解決第一個問題后,我未成功使用pip並遵循第二個建議:我重新編譯python3.5並解決了問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM