getting errror related to pkg_resources

while running PIP

PIP install cython
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.py", line 2603, in <module>
    working_set.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: pip==1.4.1
macHost:slideShow sanjeevkumar$ 

if I run pylint

$ pylint python/slideShow.py
Traceback (most recent call last):
  File "/usr/local/bin/pylint", 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.py", line 2603, in <module>
    working_set.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: pylint==1.0.0

if I run cython

$ cython
Traceback (most recent call last):
  File "/usr/local/bin/cython", line 5, in <module>
    from pkg_resources import load_entry_point
  File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 2716, in <module>

  File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 685, in require
    def __getstate__(self):
  File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 588, in resolve
    The `plugin_env` should be an ``Environment`` instance that contains
pkg_resources.DistributionNotFound: Cython==0.20.1
macHost:slideShow sanjeevkumar$ 

any help would be greatly appreciated please.

I don't use macosx, but don't you miss some python development headers ? For example can you locate the file Python.h ?

Try to open a terminal and type

locate Python.h

If you don't have the locate command, install it. You may have to update the locate database. See here for example.

when I tried to locate Python.h I got this message!!!

WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.

cython & pylint is working but not PIP: now its giving this error:

$ pip install freeze
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 11, in <module>
    load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
  File "build/bdist.macosx-10.6-intel/egg/pkg_resources.py", line 353, in load_entry_point
  File "build/bdist.macosx-10.6-intel/egg/pkg_resources.py", line 346, in get_distribution
  File "build/bdist.macosx-10.6-intel/egg/pkg_resources.py", line 225, in get_provider
  File "build/bdist.macosx-10.6-intel/egg/pkg_resources.py", line 685, in require
  File "build/bdist.macosx-10.6-intel/egg/pkg_resources.py", line 588, in resolve
pkg_resources.DistributionNotFound: pip==1.4.1

mystery solved, I discovered I had two version of pip installed, so i got rid of one that was in /usr/local/bin/pip-2.7 then everything is working fine.

Run the command sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist, then you can use the locate command to find your files. Locate creates a database with your filenames.

This question has already been answered. Start a new discussion instead.