7

如何在Mac上卸载Python

 2 years ago
source link: https://www.purewhite.io/2017/05/21/how-to-delete-python-on-mac/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

如何在 Mac 上卸载 Python

发表于 2017-05-21 更新于 2021-12-02 分类于 python 阅读次数:312 Disqus:0 Comments 本文字数: 847 阅读时长 ≈ 2 分钟
  1. Remove the Python 2.7 framework

    sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7

  2. Remove the Python 2.7 applications directory

    sudo rm -rf "/Applications/Python 2.7"

  3. Remove the symbolic links in /usr/local/bin that point to this Python version see ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' and then run the following command to remove all the links:

    cd /usr/local/bin/
    ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | tr -d @ | xargs rm
  4. If necessary, edit your shell profile file(s) to remove adding /Library/Frameworks/Python.framework/Versions/2.7 to your PATH environment file. Depending on which shell you use, any of the following files may have been modified: ~/.bash_login, ~/.bash_profile, ~/.cshrc, ~/.profile, ~/.tcshrc, and/or ~/.zprofile.

转自:How to uninstall Python 2.7 on a Mac OS X 10.6.4?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK