本文翻译自:How to uninstall Python 2.7 on a Mac OS X 10.6.4?

I want to completely remove Python 2.7 from my Mac OS X 10.6.4. 我想从Mac OS X 10.6.4中完全删除Python 2.7。 I managed to remove the entry from the PATH variable by reverting my .bash_profile . 我设法通过还原.bash_profilePATH变量中删除了该条目。 But I also want to remove all directories, files, symlinks, and entries that got installed by the Python 2.7 install package. 但是我也想删除所有由python 2.7安装包安装的目录,文件,符号链接和条目。 I've got the install package from http://www.python.org/ . 我从http://www.python.org/获得了安装包。 What directories/files/configuration file entries do I need to remove? 我需要删除哪些目录/文件/配置文件条目? Is there a list somewhere? 某处有清单吗?


#1楼

参考:https://stackoom.com/question/G1c1/如何在Mac-OS-X-上卸载Python


#2楼

This one works: 这个作品:

cd /usr/local/bin/
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | tr -d @ | xargs rm

Description: It list all the links, removes @ character and then removes them. 说明:列出所有链接,删除@字符,然后删除它们。


#3楼

If you installed it using the PKG installer, you can do: 如果使用PKG安装程序安装了它,则可以执行以下操作:

pkgutil --pkgs

or better: 或更好:

pkgutil --pkgs | grep org.python.Python

which will output something like: 这将输出类似:

org.python.Python.PythonApplications-2.7
org.python.Python.PythonDocumentation-2.7
org.python.Python.PythonFramework-2.7
org.python.Python.PythonProfileChanges-2.7
org.python.Python.PythonUnixTools-2.7

you can now select which packages you will unlink (remove). 您现在可以选择要取消链接(删除)的软件包。

This is the unlink documentation: 这是取消链接文档:

 --unlink package-idUnlinks (removes) each file referenced by package-id. WARNING: This command makes no attempt to perform reference counting or dependency analy-sis. It can easily remove files required by your system. It may include unexpected files due to package tainting. Use the --files command firstto double check.

In my example you will type 在我的示例中,您将输入

pkgutil --unlink org.python.Python.PythonApplications-2.7
pkgutil --unlink org.python.Python.PythonDocumentation-2.7
pkgutil --unlink org.python.Python.PythonFramework-2.7
pkgutil --unlink org.python.Python.PythonProfileChanges-2.7
pkgutil --unlink org.python.Python.PythonUnixTools-2.7

or in one single line: 或一行:

pkgutil --pkgs | grep org.python.Python | xargs -L1 pkgutil -f --unlink

Important: --unlink is not available anymore starting with Lion (as of Q1`2014 that would include Lion, Mountain Lion, and Mavericks). 重要提示:--unlink从Lion(从2014年第一季度开始,包括Lion,Mountain Lion和Mavericks)不再可用。 If anyone that comes to this instructions try to use it with lion, should try instead to adapt it with what this post is saying: https://wincent.com/wiki/Uninstalling_packages_(.pkg_files)_on_Mac_OS_X 如果涉及此说明的任何人都尝试将其与狮子一起使用,则应尝试改编本文所讲的内容: https : //wincent.com/wiki/Uninstalling_packages_(.pkg_files)_on_Mac_OS_X


#4楼

No need to uninstall old python versions. 无需卸载旧的python版本。

Just install new version say python-3.3.2-macosx10.6.dmg and change the soft link of python to newly installed python3.3 只需安装新版本,说python-3.3.2-macosx10.6.dmg并将python的软链接更改为新安装的python3.3

Check the path of default python and python3.3 with following commands 使用以下命令检查默认python和python3.3的路径

"which python" and "which python3.3" “哪个python”和“哪个python3.3”

then delete existing soft link of python and point it to python3.3 然后删除python的现有软链接并将其指向python3.3


#5楼

关于删除符号链接,我发现这很有用。

find /usr/local/bin -lname '../../../Library/Frameworks/Python.framework/Versions/2.7/*' -delete

#6楼

Note : If you installed Python using Homebrew, then you can follow the following steps, otherwise look for another solution! 注意如果使用Homebrew安装了Python,则可以按照以下步骤操作,否则请寻找其他解决方案!


To uninstall Python 2.7.10 which you installed using Homebrew, then you can simply issue the following command: 要卸载使用Homebrew安装的Python 2.7.10,可以简单地发出以下命令:

brew uninstall python

Similarly, if you want to uninstall Python 3 (which you installed using Homebrew): 同样,如果要卸载Python 3(使用Homebrew安装),请执行以下操作:

brew uninstall --force python3

如何在Mac OS X 10.6.4上卸载Python 2.7?相关推荐

  1. python installer 在 mac 运行_python – 如何在Mac OS X 10.7中的virtualenv中安装PyAudio

    我努力了 easy_install pyaudio 它不起作用我得到以下内容: Searching for pyaudio Reading http://pypi.python.org/simple/ ...

  2. Mac OS X 10.8.3搭建Android工程源码的编译环境(解决找不到GCC、GIT、PYTHON的问题)...

    Mac OS X 10.8.3上搭建4.0以上android版本的编译环境只需要执行下面红色字体标注的操作: Setting up a Mac OS X build environment In a ...

  3. VM10装Mac OS X 10.9.3

    最近想着搞搞Mac玩玩滴,可是屌丝程序员一枚,资金还不够富裕,只好在虚拟机上跑跑啦,熟悉了然后入手昨天苹果公司刚刚发布的最新MacBookPro,嘿嘿,公司电脑配置还可以,没想到安上之后毫无卡顿的感觉 ...

  4. mac os android sd卡,如何在Mac OS下永久删除SD卡上的文件?

    Mac数据恢复软件可以轻松恢复已删除或格式化的数据.因此,在Mac OS下从SD卡删除文件时,Mac数据恢复软件也可以恢复删除的文件.在某些情况下,仅删除是不够的.例如,当您要丢弃旧的SD卡时,应确保 ...

  5. Mac OS X 10.10, Eclipse+ADT真机调试代码时,Device Chooser中不显示真机的解决方式

    Mac OS X 10.10的环境下.Eclipse+ADT,进行真机调试时,会出现一个问题. Device Chooser对话框里不显示真机设备,仅仅有又一次插拔数据线才干够. 经过測试.有两个暂时 ...

  6. VMware Workstation 10装Mac OS X 10.9

    今儿来兴致想装个Mac系统,比较顺利,记录一下. 全文摘自http://bbs.pcbeta.com/viewthread-1418055-1-1.html,要是图挂了直接上源文章看就行. 准备工作: ...

  7. Mac OS X 10.8.X编译Android4.2.X源码不生成emulator的问题

    编译时的提示: Checking build tools versions- build/core/main.mk:165: ************************************* ...

  8. Windows 8.1下安装Mac OS X 10.8虚拟机

    转载自http://blog.csdn.net/jordanxinwang/article/details/43637799 1.准备 宿主操作系统:Windows 8.1 64位.特别地,需要CPU ...

  9. VMware 11完全安装Mac OS X 10.10

    ----------------------------------------- 引用原文如下: VMware 11安装Mac OS X 10.10_百度经验 http://jingyan.baid ...

最新文章

  1. ACM SIGKDD | MoFlow:基于流的分子图生成模型
  2. Cocos2d中使用颜色混合:加算,减算
  3. Ubuntu9.10下安装Thinkpad T400 R29无线网卡
  4. 基于 APIGateway 打造生产级别的 Knative 服务
  5. JS基础语法(04)-逗号运算符
  6. html标签转换含义,html标签含义
  7. 闪光css,CSS实现的一闪而过的图片闪光效果
  8. 参数设置_变频器基本参数设置
  9. vmWare中安装centos7
  10. 5 kvm虚拟磁盘扩容
  11. 从零实现深度学习框架——手写前馈网络实现电影评论分类
  12. Linux多线程编程-线程间参数传递
  13. word文档怎么给数字加千分符_如何在word中设置数字的千位分隔符?两种方法轻松搞定...
  14. meltdown linux检测,检查你的Linux PC是否受Meltdown和Spectre安全缺陷影响
  15. 指纹识别综述(9): 指纹系统安全
  16. 零基础学java(6)——面向对象的基本特征
  17. IO_FILE——FSOP、house of orange
  18. OJDBC版本区别 [ojdbc14.jar,ojdbc5.jar和ojdbc6.jar的区别]
  19. python3.4教程_Python教程(四)
  20. hisi3559平台PCIE转USB调试

热门文章

  1. 轻量级性能测试工具之Apache Benchmark
  2. java 并发原子性与易变性 来自thinking in java4 21.3.3
  3. Visio画UML图基本操作及技巧解析
  4. Ghost网络克隆详细步骤教程
  5. 图论:有源汇有上下界最小流
  6. Spring发送基于freemarker模板的邮件
  7. FreeMarker语言概述(1)
  8. nyoj 谁是最好的Coder
  9. 系统安装-黑苹果之路
  10. Sql Server 2005“该用户与可信的SQL SERVER 连接无关联”解决方法