从我可以告诉RHEL/CentOS的某些版本有某种问题与backports.ssl匹配主机名包在他们的百胜当其他后端软件包从PyPI更新时可能导致问题。
> yum install python-pip # indirectly installs backports.ssl-match-hostname
> pip2 install pylint # indirectly installs backports.functools_lru_cache
> pip2 install --upgrade backports.ssl-match-hostname # install latest package from pypi, which effectively corrupts backports.functools_lru_cache
> python2 -m pylint --version # fails with missing import backports.functools_lru_cache
,以避免这一点,我发现的唯一方法是从PyPI将相当于一个更换百胜安装的软件包:具体而言,在RHEL7.2环境如下我转载的问题。这可以按如下方式完成:
> yum install python-pip # installs backports.ssl-match-hostname as a transitive dependency
> pip2 freeze > temp_reqs.txt # take a snapshot of the installed packages and versions
> pip2 uninstall backports.ssl-match-hostname # remove the yum installed package
> pip2 install -r temp_reqs.txt # reinstall the same version of the backports package, but install from PyPI
现在安装的软件包应该按预期工作。执行以下测试用例证实了这一点:
> pip2 install pylint
> pip2 install --upgrade backports.ssl-match-hostname # previously caused corruption of backports.functools_lru_cache used by pylint
> python2 -m pylint --version # now works correctly
希望这可以帮助其他人解决此问题。
哪个版本的pylint是它? – Chr
你是如何安装pylint的? –
我使用了pip install pylint命令 –