我尝试在 CentOS 7 Home Server 上运行 Debian 11 VM,但在 virt-install 中遇到了此问题

我尝试在 CentOS 7 Home Server 上运行 Debian 11 VM,但在 virt-install 中遇到了此问题

请参阅下文,我在尝试单独运行 virt-install 时遇到的问题。当我尝试使用我计划使用的所有配置时,出现同样的问题:

/usr/lib/python2.7/site-packages/requests/__init__.py:104: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (2.2.1)/charset_normalizer (None) doesn't match a supported version!
  RequestsDependencyWarning)
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-install", line 29, in <module>
    import virtinst
  File "/usr/share/virt-manager/virtinst/__init__.py", line 90, in <module>
    from virtinst.distroinstaller import DistroInstaller
  File "/usr/share/virt-manager/virtinst/distroinstaller.py", line 23, in <module>
    from . import urlfetcher
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 33, in <module>
    import requests
  File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 133, in <module>
    from . import utils
  File "/usr/lib/python2.7/site-packages/requests/utils.py", line 27, in <module>
    from . import certs
  File "/usr/lib/python2.7/site-packages/requests/certs.py", line 15, in <module>
    from certifi import where
  File "/usr/lib/python2.7/site-packages/certifi/__init__.py", line 1, in <module>
    from .core import contents, where
  File "/usr/lib/python2.7/site-packages/certifi/core.py", line 17
    def where() -> str:
                ^
SyntaxError: invalid syntax

我还看到突出显示的主要问题/usr/lib/python2.7/site-packages/requests/__init__.py:104: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (2.2.1)/charset_normalizer (None) doesn't match a supported version!

搜索后,我看到一个链接:https://stackoverflow.com/questions/50202238/python-pip-requestsdependencywarning-urllib3-1-9-1-or-chardet-2-3-0-doe

遵循此操作也不起作用,因为 pip 似乎不想工作:

pip install --upgrade urllib
Traceback (most recent call last):
  File "/bin/pip", line 9, in <module>
    load_entry_point('pip==8.1.2', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 15, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python2.7/site-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/usr/lib/python2.7/site-packages/pip/download.py", line 39, in <module>
    from pip._vendor import requests, six
  File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/__init__.py", line 64, in <module>
    from . import utils
  File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.py", line 23, in <module>
    from . import certs
  File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/certs.py", line 17, in <module>
    from certifi import where
  File "/usr/lib/python2.7/site-packages/certifi/__init__.py", line 1, in <module>
    from .core import contents, where
  File "/usr/lib/python2.7/site-packages/certifi/core.py", line 17
    def where() -> str:
                ^
SyntaxError: invalid syntax

我完全陷入困境,不知道如何进步。

我的主要目标是运行这个软件 -https://github.com/ab77/netflix-proxy尽管我只搭建了一台 CentOS 7 服务器,而且我不打算用 Debian 重新安装机器,除非有人有更好的解决方案,否则我还是打算继续模拟。

答案1

嗨,我今天也遇到了同样的问题。我的解决方案是删除该目录/usr/lib/python2.7/site-packages/certifi。后来我用pip安装了2020.4.5.1版本 pip install certifi==2020.4.5.1

答案2

这个问题很新,我发现这是由Tornado引起的,在tornado-4.4.2.tar.gz里面,我发现这个文档说: Tornado 现在依赖于certifi <https://pypi.python.org/pypi/certifi>_ 包,而不是捆绑它自己的 Mozilla CA 列表副本。当使用pip或 时,这将自动安装easy_install

并前往https://pypi.python.org/pypi/certifi,它显示的是最新版本:证书 2022.5.18.1 我正在使用docker,所以在我的Dockerfile中,安装Tornado后,我使用了cordiliere的建议(谢谢),

运行 rm -r /usr/lib/python2.7/site-packages/certifi

运行 pip install certifi==2020.4.5.1

它对我有用。

希望这会在下一个证书中得到解决

相关内容