PIP error on MacOS

1

I'm trying to use PIP in my Mac but it doesn't work. What is missing and how can I fix it?

pip --version
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3095, in <module>
    @_call_aside
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3081, in _call_aside
    f(*args, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 658, in _build_master
    ws.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 959, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 846, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==18.1' distribution was not found and is required by the application

user11361925

Posted 2019-04-15T07:47:09.313

Reputation: 11

Your tags say Linux? How did you install pip? Did you run any commands related to Python before? When did this issue start? – slhck – 2019-04-15T09:25:44.947

Answers

1

I recommend you try pipenv, which is a thin wrapper of pip and virtualenv. It allow you create independent pip environments, that do not interfere with each other and the global pip config. Perhaps it will help bypass your problem.

Geo Systems

Posted 2019-04-15T07:47:09.313

Reputation: 76