删除与Brew安装位置不同的Python框架文件的最安全方法是什么 [英] What is the safest way to removing Python framework files that are located in different place than Brew installs
问题描述
当我运行brew doctor
警告: Python安装在/Library/Frameworks/Python.framework
Warning: Python is installed at /Library/Frameworks/Python.framework
什么是最好的方法?
这里有更多详细信息/研究:
啤酒git的消息网站:
重要提示:如果您选择安装以下任一版本的Python 这两个(系统Python或Brewed Python),Homebrew团队只能 提供有限的支持.
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/
I want to make sure I am not missing anything before I remove the extra python libary. Specifically, I want to remove the entire Python.framework, those files located here. /Library/Frameworks/Python.framework/
我在本地安装了Mavericks的Python 2.7.5,将在下面的路径中使用. (区别是-我相信-它放在根/System文件夹中,而不是根/Library文件夹中.)好的本地位置在这里:
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
I have Python 2.7.5 installed natively with Mavericks that I'll use instead - located in the path below. (The difference being -- I believe -- that its put in the root /System folder instead of the root /Library folder.) The good, native location is here:
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
并且我已经用brew install python3
安装了python 3.x,将其放在这里:
and I already installed python 3.x with brew install python3
, which put it here:
==> Summary
/usr/local/Cellar/python3/3.4.0 : 5076 files, 85M, built in 112 seconds
我可以删除这些文件还是它们的后果(不必重新链接)?
/Library/Frameworks/Python.framework/
Can I just delete these files or are their consequences (beyond having to relink)?
/Library/Frameworks/Python.framework/
以下是从类似的问题在这里
这种方法还听起来不错吗?我有什么需要注意的吗?
Is that approach still sound? Is there anything I should be aware of?
推荐答案
我会自我解答.我经历了一些步骤,这很简单. Pycharms(我正在使用的IDE)也会自动找到新的库.下面是我按照步骤删除Mavericks上不属于本机且未由brew安装的其他Python库.
I'll self-answer. I went through steps and it's straight forward. Pycharms (the IDE I'm use) automatically found the new libraries too. Here are the steps I followed to remove the extra Python libraries on Mavericks that were not native to it and not installed by brew.
第1步:
本地Python 2.7.x版本位于/System/Library/Frameworks/Python.framework/Versions/2.7
(或2.6等)中,因此您可以删除在其他位置安装的所有Python.
Step 1:
The native Python 2.7.x version lives here /System/Library/Frameworks/Python.framework/Versions/2.7
(or 2.6, etc), so you can remove any Python that got installed elsewhere.
sudo rm -rf /System/Library/Frameworks/Python.framework/
或者,根据此文章,您应该冲泡安装python 2.7和python 3.x 并避免在Mavericks中使用系统python.
Or, according to this article, you should brew install both python 2.7 and python 3.x, and avoid using system python in Mavericks.
第2步: 在Applications目录(您的所有应用所在的目录)中删除python.
Step 2: Remove python in Applications directory (the one where all your apps are).
cd进入文件夹/Applications
和ls | grep Python
来查看内容.
cd into folder /Applications
and ls | grep Python
to see what have.
然后删除:
sudo rm -rf "Python 3.3"
第3步:
>>> brew prune
示例输出:
修剪0个死公式从/usr/local修剪46个符号链接
Pruned 0 dead formula Pruned 46 symbolic links from /usr/local
步骤4:运行brew doctor
sudo brew link python3
样本输出
链接/usr/local/Cellar/python3/3.4.0 ...已创建19个符号链接
Linking /usr/local/Cellar/python3/3.4.0... 19 symlinks created
这篇关于删除与Brew安装位置不同的Python框架文件的最安全方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!