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.


  • 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*
    
  • 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
    
  • Try again, and enjoy. Eg:

    sudo easy_install pip
    

  • I suspect the easiest way you can get easy_install working again is to install distribute , which is an improved version of distutils that bundles it's own version of easy_install . Installation is simple:

    curl -O http://python-distribute.org/distribute_setup.py
    /usr/bin/python2.6 distribute_setup.py
    

    I had the same problem just after installing the new Operating System (Lion OSX). After install python and execute it

    sudo easy_install ipython
    ipython
    

    I got the following error:

    Traceback (most recent call last):
      File "/usr/local/bin/ipython", line 8, in <module>
        load_entry_point('ipython==0.10.2', 'console_scripts', 'ipython')()
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 318, in load_entry_point
        return get_distribution(dist).load_entry_point(group, name)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2220, in load_entry_point
        raise ImportError("Entry point %r not found" % ((group,name),))
    ImportError: Entry point ('console_scripts', 'ipython') not found
    

    Then I realize it was a permission problem. If I execute the ipython script as sudo it worked.

    sudo ipython
    

    So I changed the ownership from root to my user () of the folder /Library/Python/2.7/site-packages/

    sudo chown -R <your_user>:wheel /Library/Python/2.7/site-packages/
    

    Use change ownership only if you don't have several accounts that uses python.

    I hope it work for you.

    Best

    链接地址: http://www.djcxy.com/p/26392.html

    上一篇: pip.py校验和? 我可以在哪里得到它?

    下一篇: 安装不能在我的Mac上工作?