pkg_resources.DistributionNotFound
See original GitHub issueUsing OS X version 10.10.3, pip 7.0.3installed in /Library/Python/2.7/site-packages/pip-7.0.3-py2.7.egg, (python 2.7):
Any module I try to install now returns the error pkg_resources.DistributionNotFound: ... when trying to execute the installed module. Pip seems to install the modules successfully, although executing anything afterward results in this behavior.
$ pip install mitmproxy
Requirement already satisfied (use --upgrade to upgrade): mitmproxy in /Library/Python/2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): pyperclip>=1.5.8 in /Library/Python/2.7/site-packages (from mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): pyasn1>0.1.2 in /Library/Python/2.7/site-packages (from mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): tornado>=4.0.2 in /Library/Python/2.7/site-packages (from mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): lxml>=3.3.6 in /Library/Python/2.7/site-packages (from mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): pyOpenSSL>=0.14 in /Library/Python/2.7/site-packages (from mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): netlib<0.13,>=0.12 in /Library/Python/2.7/site-packages (from mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): blinker>=1.3 in /Library/Python/2.7/site-packages (from mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): Pillow>=2.3.0 in /Library/Python/2.7/site-packages (from mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): urwid>=1.3 in /Library/Python/2.7/site-packages (from mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): configargparse>=0.9.3 in /Library/Python/2.7/site-packages (from mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): backports.ssl-match-hostname in /Library/Python/2.7/site-packages (from tornado>=4.0.2->mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): certifi in /Library/Python/2.7/site-packages (from tornado>=4.0.2->mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in /Library/Python/2.7/site-packages (from pyOpenSSL>=0.14->mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): cryptography>=0.7 in /Library/Python/2.7/site-packages (from pyOpenSSL>=0.14->mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): passlib>=1.6.2 in /Library/Python/2.7/site-packages (from netlib<0.13,>=0.12->mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): idna in /Library/Python/2.7/site-packages (from cryptography>=0.7->pyOpenSSL>=0.14->mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from cryptography>=0.7->pyOpenSSL>=0.14->mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): enum34 in /Library/Python/2.7/site-packages (from cryptography>=0.7->pyOpenSSL>=0.14->mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): ipaddress in /Library/Python/2.7/site-packages (from cryptography>=0.7->pyOpenSSL>=0.14->mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): cffi>=0.8 in /Library/Python/2.7/site-packages (from cryptography>=0.7->pyOpenSSL>=0.14->mitmproxy)
Requirement already satisfied (use --upgrade to upgrade): pycparser in /Library/Python/2.7/site-packages (from cffi>=0.8->cryptography>=0.7->pyOpenSSL>=0.14->mitmproxy)
Installation seems to be fine, however, executing the command results in:
$ mitmproxy
Traceback (most recent call last):
  File "/usr/local/bin/mitmproxy", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/Library/Python/2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 2671, in <module>
    working_set.require(__requires__)
  File "/Library/Python/2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 654, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/Library/Python/2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 552, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: Pillow>=2.3.0
Another example:
$ pip install clf
Collecting clf
  Downloading clf-0.5.5.tar.gz
Collecting Pygments>=1.5 (from clf)
  Downloading Pygments-2.0.2-py2-none-any.whl (672kB)
    100% |################################| 675kB 8.0MB/s 
Collecting docopt>=0.6.0 (from clf)
  Downloading docopt-0.6.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): requests>=2.3.0 in /Library/Python/2.7/site-packages (from clf)
Installing collected packages: docopt, Pygments, clf
  Running setup.py install for docopt
  Running setup.py install for clf
    Installing clf script to /usr/local/bin
Successfully installed Pygments-2.0.2 clf-0.5.5 docopt-0.6.2
Executing the command:
$ clf osx
Traceback (most recent call last):
  File "/usr/local/bin/clf", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/Library/Python/2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 2671, in <module>
    working_set.require(__requires__)
  File "/Library/Python/2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 654, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/Library/Python/2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 552, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: requests>=2.3.0
I’m not sure what happened to pip, as nothing recently changed in my environment, and pip seemed to be working fine before.
Issue Analytics
- State:
 - Created 8 years ago
 - Comments:9 (1 by maintainers)
 
Top Results From Across the Web
pip broke. how to fix DistributionNotFound error?
I installed pip through easy_install which probably caused me this headache. I think this is how you should do it nowadays.. $ sudo...
Read more >Troubleshooting pkg_resources.DistributionNotFound #1495
I ran into the pkg_resources.DistributionNotFound error while attempting to fix his troubles.
Read more >The 'rospkg==1.2.3' distribution was not found and is required ...
My problem is pkg_resources.DistributionNotFound: The 'rospkg>=1.2.7' distribution was not found and is required by rosdep , solved with pip ...
Read more >Error pkg_resources.DistributionNotFound: ReviewBoard after ...
I've followed the installation procedure on mu Ubuntu box 14.04, using Apache as HTTP server and PostgreSQL. I've successfully created the site, ...
Read more >kombu>=4.0.2,<5.0 - Red Hat Customer Portal
Red Hat Satellite or Capsule installation\upgrade fails on pulp-manage-db step with error "pkg_resources.DistributionNotFound: kombu>=4.0.2,<5.0 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks for the warning — it prepared me for what was coming.
I’m not exactly sure how I fixed the problem to be quite honest, since after uninstalling
distributebothpipandeasy_installseemed to be completely borked. I think the key thing that got pip back on track was to use the--upgradeflag onsetuptoolsafter reinstalling:Ran into a similar problem. El Capitan has System Integrity Protection I needed to add
--userto @Ubiquitous’ solution:sudo pip install --user --upgrade setuptoolssolved it for me