当我运行 brew doctor
Warning: Python is installed at /Library/Frameworks/Python.framework
最好的方法是什么?
这里有更多细节/研究:
来自 brew git website 的消息:
Important: If you choose to install a Python which isn't either of these two (system Python or brewed Python), the Homebrew team can only provide limited support.
我想确保在删除多余的 python 库之前没有遗漏任何内容。 具体来说,我想删除整个 Python.framework,这些文件位于此处。 /Library/Frameworks/Python.framework/
我已经使用 Mavericks 本地安装了 Python 2.7.5,我将使用它来代替 - 位于下面的路径中。 (区别在于 - 我相信 - 它放在 root/System 文件夹 而不是 root/Library 文件夹。)好的本地位置在这里:
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
我已经用 brew install python3
安装了 python 3.x,把它放在这里:
==> Summary
/usr/local/Cellar/python3/3.4.0 : 5076 files, 85M, built in 112 seconds
我可以只删除这些文件还是它们的后果(不必重新链接)?
/Library/Frameworks/Python.framework/
以下是从 stackoverflow question in 2010 中删除 python 的步骤。和 similar question here
这种方法仍然有效吗?有什么需要注意的吗?
最佳答案
我会自己回答。我经历了一些步骤,它是直截了当的。 Pycharms(我使用的 IDE)也自动找到了新的库。以下是我在 Mavericks 上删除额外的 Python 库所遵循的步骤,这些库不是原生的,也不是由 brew 安装的。
第 1 步:
原生 Python 2.7.x 版本位于 /System/Library/Frameworks/Python.framework/Versions/2.7
(或 2.6 等),因此您可以删除安装在其他地方的任何 Python。
sudo rm -rf/System/Library/Frameworks/Python.framework/
或者,根据这个 article , 你应该同时安装 python 2.7 和 python 3.x, 并避免在 Mavericks 中使用系统 python。
第 2 步: 在 Applications 目录(所有应用程序所在的目录)中删除 python。
cd 进入文件夹 /Applications
和 ls | grep Python
看看有什么。
然后删除:
sudo rm -rf "Python 3.3"
第 3 步:
>>> brew prune
样本输出:
Pruned 0 dead formula Pruned 46 symbolic links from /usr/local
第四步:运行brew doctor
sudo brew link python3
样本输出
Linking /usr/local/Cellar/python3/3.4.0... 19 symlinks created
关于python - 删除与 Brew 安装位置不同的 Python 框架文件的最安全方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22774529/