從我可以告訴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命令 –