Environment
Description
python installed with homebrew
running pip -v or pip upgrade or anything else with pip
Output
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 19.0.3 (/usr/local/lib/python3.7/site-packages), Requirement.parse('pip==19.0.2'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/opt/python/libexec/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3191, in <module>
@_call_aside
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3175, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==19.0.2' distribution was not found and is required by the application
I'm with the same problem
I also have the same issue
This looks like an issue in /usr/local/opt/python/libexec/bin/pip which presumably is supplied by homebrew, so I'd suggest raising an issue with them. It looks like you have a copy of that file from pip 19.0.2, but have pip 19.0.3 installed.
u can check it first by
which pip3
mine is /usr/local/bin instead of /usr/bin
and that's the problem.
so i do as the follow:
sudo rm -rf /usr/local/bin/pip3
sudo ln -s /usr/local/your_python_path/bin/pip3 /usr/local/bin/pip3
pip3 -version
This is an ongoing problem caused by homebrew, occurs when you upgrade pip. As @pfmoore said the pip executable file provided by homebrew is the culprit, it has a hardcoded pip version requirement in it.
The easiest way is to just run brew reinstall python to fix this problem.
You can try pip install pip --upgrade afterwards and break it again to confirm.
I found that:
easy_install pip
worked for me
Closing since there's nothing actionable here. Homebrew should fix this issue on their end.
Most helpful comment
This is an ongoing problem caused by homebrew, occurs when you upgrade pip. As @pfmoore said the pip executable file provided by homebrew is the culprit, it has a hardcoded pip version requirement in it.
The easiest way is to just run brew reinstall python to fix this problem.
You can try pip install pip --upgrade afterwards and break it again to confirm.