Skip to content

Instantly share code, notes, and snippets.

@hkulekci
Last active December 17, 2015 00:29
Show Gist options
  • Select an option

  • Save hkulekci/5521344 to your computer and use it in GitHub Desktop.

Select an option

Save hkulekci/5521344 to your computer and use it in GitHub Desktop.
Pythob Pip Error Fix

If you have an error as following

localhost:~ kulekci$ pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pkg_resources.py", line 2710, in <module>
working_set.require(__requires__)
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pkg_resources.py", line 686, in require
needed = self.resolve(parse_requirements(requirements))
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pkg_resources.py", line 584, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==1.3.1

You can use following solution to fix it. First of all, cat /usr/local/bin/pip file:

#!/Library/Frameworks/Python.framework/Versions/3.2/Resources/Python.app/Contents/MacOS/Python
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==1.3.1','console_scripts','pip'
__requires__ = 'pip==1.3.1'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('pip==1.3.1', 'console_scripts', 'pip')()
    )

After that i changed the first line like this with nano

#!/Library/Frameworks/Python.framework/Versions/3.3/Resources/Python.app/Contents/MacOS/Python

Because my current python version was 3.3.1. python3 -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3At the end, pip was fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment