Uninstall python.org version of python2.7 in favor of default OS X python2.7

那年仲夏 提交于 2019-12-02 20:57:43

There are three things making up the python.org python install which need to be removed. These steps worked for me:

  1. Remove the actual Python install:

    rm -rf /Library/Frameworks/Python.framework
    
  2. Remove the Python.org extra applications by deleting the folder at /Applications/Python 2.7:

    rm -rf /Applications/Python\ 2.7
    
  3. Remove the symlinks to the python executables from your /usr/local/bin directory:

    find /usr/local/bin -type l -and -lname "/Library/Frameworks/Python.framework*" -delete
    
  4. Remove or comment out these lines from your bash startup script (either ~/.profile or ~/.bash_profile):

    # Setting PATH for Python 2.7
    # The orginal version is saved in .profile.pysave
    PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
    export PATH
    

Some of these steps may require super-user privileges via e.g. sudo. Once this is done, you should have only the original Mac.

Based on documentation at http://docs.python.org/2/using/mac.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!