关于pip安装时提示pkg_resources.DistributionNotFound 错误问题

Tags:  pip  

一开始使用了pip --upgrade pip 来升级pip,但是升级完后出现了
[root@vultrvpn ~]# pip install ffmpy         
Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2927, in <module>
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2913, in _call_aside
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 637, in _build_master
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 650, in _build_from_requirements
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 829, in resolve
pkg_resources.DistributionNotFound: The 'pip==8.1.1' distribution was not found and is required by the application

即使重新安装过pip也不行,重新确认信息,/usr/bin/pip第五行问题
[root@vultrvpn ~]# cat /usr/bin/pip
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==8.1.1','console_scripts','pip'
__requires__ = 'pip==8.1.1'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('pip==8.1.1', 'console_scripts', 'pip')()
    )

 这里面还是8.1.1的,所以手动改为8.1.2的就可以了
[root@vultrvpn ~]# cat /usr/bin/pip
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==8.1.2','console_scripts','pip'
__requires__ = 'pip==8.1.2'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('pip==8.1.2', 'console_scripts', 'pip')()
    )

    再次  安装  就    正常 了
[root@vultrvpn ~]# pip install ffmpy
Collecting ffmpy
  Downloading ffmpy-0.1.0.tar.gz
Installing collected packages: ffmpy
  Running setup.py install for ffmpy ... done
Successfully installed ffmpy-0.1.0