本人用的系统版本是centos7.6(代码只执行黑底白字部分)
报错信息:
Traceback (most recent call last):
File "/usr/share/virt-manager/virt-manager", line 35, in
from virtinst import util as util
File "/usr/share/virt-manager/virtinst/__init__.py", line 90, in
from virtinst.distroinstaller import DistroInstaller
File "/usr/share/virt-manager/virtinst/distroinstaller.py", line 23, in
from . import urlfetcher
File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 33, in
import requests
File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 58, in
from . import utils
File "/usr/lib/python2.7/site-packages/requests/utils.py", line 32, in
from .exceptions import InvalidURL
File "/usr/lib/python2.7/site-packages/requests/exceptions.py", line 10, in
from urllib3.exceptions import HTTPError as BaseHTTPError
File "/usr/lib/python2.7/site-packages/urllib3/__init__.py", line 8, in
from .connectionpool import (
File "/usr/lib/python2.7/site-packages/urllib3/connectionpool.py", line 11, in
from .exceptions import (
File "/usr/lib/python2.7/site-packages/urllib3/exceptions.py", line 2, in
from .packages.six.moves.http_client import (
File "/usr/lib/python2.7/site-packages/urllib3/packages/__init__.py", line 3, in
from . import ssl_match_hostname
ImportError: cannot import name ssl_match_hostname
我正在查看我的解决方法,发现有些奇怪。
python2-urllib3,这个软件包显然是我的问题的根源。
[CUT]
Warning: No matches found for: python2-urllib3
No matches found
警告:找不到以下内容的匹配项:python2-urllib3
找不到匹配项
[CUT]
python-urllib3.noarch : Python HTTP library with thread-safe connection pooling and file post
python34-urllib3.noarch : Python 3.6 HTTP library with thread-safe connection pooling and file post
python36-urllib3.noarch : Python 3.6 HTTP library with thread-safe connection pooling and file post
python-urllib3.noarch:带有线程安全连接池和文件的Python HTTP库发布
python34-urllib3.noarch:具有线程安全连接池和文件发布的Python 3.6 HTTP库
python36-urllib3.noarch:具有线程安全连接池和文件发布功能的Python 3.6 HTTP库
- So I proceed removing urllib3 installed with pip2:
-因此,我继续删除通过pip2安装的urllib3:
pip2 uninstall urllib3
接下来验证依赖关系并修复错误:
yum check ( 这部看时间 可以省略,)
Loaded plugins: changelog, fastestmirror, langpacks, merge-conf
python-requests-2.6.0-8.el7_7.noarch has missing requires of python-urllib3 >= ('0', '1.10.2', '1')
Error: check all
重装 python-requests
yum reinstall python-requests
[CUT]
Resolving Dependencies
--> Running transaction check
---> Package python-requests.noarch 0:2.6.0-8.el7_7 will be reinstalled
--> Processing Dependency: python-urllib3 >= 1.10.2-1 for package: python-requests-2.6.0-8.el7_7.noarch
--> Running transaction check
---> Package python-urllib3.noarch 0:1.10.2-7.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
[CUT]
Installed:
python-requests.noarch 0:2.6.0-8.el7_7
Dependency Installed:
python-urllib3.noarch 0:1.10.2-7.el7
Complete!
至此问题解决



