Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
598 views
in Technique[技术] by (71.8m points)

macos - Why is Python easy_install not working on my Mac?

I have a Mac running Python 2.6. When I try to use easy_install I get this message:

/usr/bin/easy_install-2.6:7: UserWarning: Module pkg_resources was already imported from /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.pyc, but /Library/Python/2.6/site-packages is being added to sys.path
  from pkg_resources import load_entry_point
/usr/bin/easy_install-2.6:7: UserWarning: Module site was already imported from /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site.pyc, but /Library/Python/2.6/site-packages is being added to sys.path
  from pkg_resources import load_entry_point
Traceback (most recent call last):
  File "/usr/bin/easy_install-2.6", line 10, in <module>
    load_entry_point('setuptools==0.6c9', 'console_scripts', 'easy_install')()
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 271, in load_entry_point
    return False
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 2173, in load_entry_point
    deps = []
ImportError: Entry point ('console_scripts', 'easy_install') not found

I am very confused by this and I want to know how I can fix this. Previously I didn't get this message, then after installing pip and uninstalling it, easy_install no longer works. I was wondering how I could fix this, or restore the default Python or easy_install setting on Mac.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
  1. Check your /usr/bin and /usr/local/bin for easy_install installations and remove any old script:

    sudo rm -f /usr/bin/easy_install*
    sudo rm -f /usr/local/bin/easy_install*
    
  2. Download and run distribute:

    curl -O https://svn.apache.org/repos/asf/oodt/tools/oodtsite.publisher/trunk/distribute_setup.py
    
    sudo python distribute_setup.py
    sudo rm distribute_setup.py
    
  3. Try again, and enjoy. E.g.:

    sudo easy_install pip
    

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...