The 'pip==7.1.0' distribution was not foun

2019-01-23 01:37发布

I have the latest version of pip 8.1.1 on my ubuntu 16. But I am not able to install any modules via pip as I get this error all the time.

File "/usr/local/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
    @_call_aside
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 635, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 943, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 829, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==7.1.0' distribution was not found and is required by the application

I found a similar link, but not helpful.

7条回答
淡お忘
2楼-- · 2019-01-23 02:38

Delete all of the pip/pip3 stuff under .local including the packages.

sudo apt-get purge python-pip python3-pip

Now remove all pip3 files from local

sudo rm -rf /usr/local/bin/pip3

you can check which pip is installed other wise execute below one to remove all (No worries)

sudo rm -rf /usr/local/bin/pip3.*

Using pip and/or pip3, reinstall needed Python packages.

sudo apt-get install python-pip python3-pip
查看更多
登录 后发表回答