0

I am trying to install Pip and anaconda.

In my mac I have both python 2 as well as python 3.

When I try to easy_install pip I get the error [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-14341.write-test'

So I tried to do a pip install

I GOT

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 6, 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 3241, in <module>
    @_call_aside
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3225, in _call_aside
    f(*args, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3254, 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 585, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 598, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==19.3.1' distribution was not found and is required by the application

Also I cannot install Anaconda, maybe because of this problem

PS. I have used homebrew to install python.

Have anyone solved it?

Luca C
  • 79
  • 11
  • Have you tried this: https://stackoverflow.com/questions/6200056/pip-broke-how-to-fix-distributionnotfound-error ? – TheKewlStore Feb 12 '20 at 17:47
  • 1
    a) easy_install is deprecated. Don't use it, b) Permission denied is self-describing - use `sudo`. Although I suppose you're doing smth. wrong from start – Alex Yu Feb 12 '20 at 17:49
  • Recommendation - focus strictly on Python 3. Python 2 has reached End of Life. – 0buz Feb 12 '20 at 17:49

1 Answers1

0

One of the problem is that from now on we to use pip3 instead of just pip. Another problem is that the open ~/.zshrc file need to be updated with the same open ~/.bash_profile instruction from anaconda.

IN CONCLUSION

I think that for installing pip packages you need to use the pip3 command or you could write an alias file where you substitute pip with pip3.

Then for actually using conda I followed this article so that it overrun the zhs of the mac config.

Getting Anaconda to work

Luca C
  • 79
  • 11