Homebrew brew doctor 关于 /Library/Frameworks/Python.framework 的警告,即使安装了 brew 的 Python
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22255579/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Homebrew brew doctor warning about /Library/Frameworks/Python.framework, even with brew's Python installed
提问by ecbrodie
When I ran Homebrew'sbrew doctor(Mac OS X 10.9.2), I get the following warning message:
当我运行Homebrew'sbrew doctor(Mac OS X 10.9.2) 时,我收到以下警告消息:
Warning: Python is installed at /Library/Frameworks/Python.framework
Homebrew only supports building against the System-provided Python or a brewed Python. In particular, Pythons installed to /Library can interfere with other software installs.
警告:Python 安装在 /Library/Frameworks/Python.framework
Homebrew 仅支持针对系统提供的 Python 或 brewed Python 进行构建。特别是,安装到 /Library 的 Python 会干扰其他软件的安装。
Therefore, I ran brew installand followed the steps provided in the installation's caveats output to install Homebrew's version of Python. Running which pythonconfirms that Homebrew's version of it is indeed at the top of my PATH. Output is /usr/local/bin/python.
因此,我运行brew install并按照安装警告输出中提供的步骤安装 Homebrew 版本的Python。运行which python确认 Homebrew 的版本确实在我的PATH的顶部。输出是/usr/local/bin/python。
Despite all this, when I rerun brew doctor, I am still getting the same warning message. How do I suppress this warning? Do I need to delete the /Library/Frameworks/Python.framework directory from my computer? Am I just supposed to ignore it? Is there a different application on my computer that may be causing this warning to emit?
尽管如此,当我重新运行时brew doctor,我仍然收到相同的警告消息。如何抑制此警告?我需要从我的计算机中删除 /Library/Frameworks/Python.framework 目录吗?我应该忽略它吗?我的计算机上是否有其他应用程序可能导致发出此警告?
Note that I don't have any applications in particular that are running into errors due to this warning from brew doctor. Also note that this warning message didn't always print out when I ran brew doctor, it was something that started to appear recently. Also, I am using Python 2.7 on my computer, trying to stay away from Python 3.
请注意,我没有任何特定的应用程序由于来自brew doctor. 另请注意,此警告消息在我运行时并不总是打印出来brew doctor,它是最近开始出现的。另外,我在我的电脑上使用 Python 2.7,试图远离 Python 3。
采纳答案by SherMM
I had the same problem. When I upgraded python3 through Homebrew, I started getting this:
我有同样的问题。当我通过 Homebrew 升级 python3 时,我开始得到这个:
-bash: python3: command not found
I had the same conflict with Python somehow being installed in /Library/Framework/Python.framework. I just did a brew link overwriteand everything is working fine now. There is some info about what to do with the Python version in the /Library/Framework/Python.frameworkhere.
我与以某种方式安装在/Library/Framework/Python.framework. 我刚刚做了一个brew link overwrite,现在一切正常。这里有一些关于如何处理 Python 版本的/Library/Framework/Python.framework信息。
I guess you could try deleting that version as the link suggests, just make sure that version isn't being used. When I got into the Python.framework directory I was seeing some EPD version of Python, which I think is Enthought. You could delete it, but I if it isn't causing you any problems besides the unsightly Homebrew warning message, then I think you should just ignore it for now.
我想您可以按照链接的建议尝试删除该版本,只需确保未使用该版本即可。当我进入 Python.framework 目录时,我看到了一些 EPD 版本的 Python,我认为它是 Enthought。你可以删除它,但如果除了难看的 Homebrew 警告消息之外它没有给你带来任何问题,那么我认为你现在应该忽略它。
Update:
更新:
I did delete the Python.framework directory which, through some poking around inside that directory, I started seeing a few old versions of Python that I didn't install with Homebrew. One was from Enthought, and another was a distribution of Python3.3. I think some of these installs in the Framework directory are user installs. I installed R on my system, and there is also an R.framework directory, so I think most of these are user installs. After I deleted the directory, I just had to call brew prune to remove the old symlinks. I checked both brew versions of python 2.7.6 and 3.3.4, and they seem to be in good working order with all of my installed packages. I guess I leave the decision to remove that directory, or python version, to your discretion.
我确实删除了 Python.framework 目录,通过在该目录中的一些探索,我开始看到一些我没有用 Homebrew 安装的旧版本的 Python。一个来自Enthought,另一个是Python3.3 的发行版。我认为 Framework 目录中的一些安装是用户安装。我在我的系统上安装了 R,并且还有一个 R.framework 目录,所以我认为其中大部分是用户安装。删除目录后,我只需要调用 brew prune 来删除旧的符号链接。我检查了 python 2.7.6 和 3.3.4 的两个 brew 版本,它们似乎与我安装的所有软件包都处于良好的工作状态。我想我将删除该目录或 python 版本的决定留给您自行决定。
回答by Mike
I also received this message.
我也收到了这个消息。
Something, sometime installed
东西,有时安装
/Library/Frameworks/Python.framework
/图书馆/框架/Python.framework
on my machine (the folder date was about 4 years old).
在我的机器上(文件夹日期大约是 4 年前)。
I've chosen to remove it.
我选择删除它。
Please note that the Apple provided framework lives in
请注意,Apple 提供的框架位于
/System/Library/Frameworks/Python.framework/
/System/Library/Frameworks/Python.framework/
回答by Daniel Dropik
per this thread, enter this command:
每个线程,输入以下命令:
sudo rm -rf /Library/Frameworks/Python.framework
sudo rm -rf /Library/Frameworks/Python.framework
because there are multiple installations of Python on your computer, and this removes the one that may cause additional problems in the future.
因为在您的计算机上安装了多个 Python,这将删除可能在将来导致其他问题的那个。
回答by Eisenheim
Removing directories manually can be a nightmare, but fortunately 'brew' can take care of that. Once you are done with the removal, put this:
手动删除目录可能是一场噩梦,但幸运的是 'brew' 可以解决这个问题。完成删除后,请输入:
brew doctor
The above command will list the broken system links. In order to get rid of these broken symlinks, put this:
上面的命令将列出损坏的系统链接。为了摆脱这些损坏的符号链接,请输入:
brew prune
Check with 'brew doctor' once more to ensure no links are broken. Your system will then be ready to brew.
再次检查“brew doctor”以确保没有链接被破坏。然后您的系统将准备好冲泡。
回答by John DeLuca
You can use this solution as I've put below
您可以使用我在下面列出的解决方案
sudo rm -rf /Library/Frameworks/Python.framework
brew doctor
brew prune
brew update
That combo fixed it for me, even thought this error usually doesn't cause any major problems its just was annoying me to see them pop up under brew doctor
那个组合为我修复了它,甚至认为这个错误通常不会引起任何重大问题,只是看到它们在 brew doctor 下弹出让我很烦
回答by Elan
I had installed Python 3 from Homebrew and then another Python 3 directly from the Python website.
我从 Homebrew 安装了 Python 3,然后直接从 Python 网站安装了另一个 Python 3。
I deleted /Library/Frameworks/Python.framework. I did not add any PATHor PYTHONPATHvariables in .bash_profile. Then I checked the following in the shell:
我删除了/Library/Frameworks/Python.framework。我没有添加任何PATH或PYTHONPATH变量.bash_profile。然后我在shell中检查了以下内容:
~$ python
Python 2.7.10 (default, Feb 7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
~$ python3
Python 3.6.4 (default, Mar 9 2018, 23:15:12)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
~$
In addition, I checked the following:
此外,我检查了以下内容:
~$ whereis python
/usr/bin/python
~$ whereis python3
~$ which python
/usr/bin/python
~$ which python3
/usr/local/bin/python3
~$ which pip
/usr/local/bin/pip
~$ which pip3
/usr/local/bin/pip3
~$ whereis pip
~$ whereis pip3
I was a bit worried that whereis python3, whereis pip, and whereis pip3returned nothing, but since there was no problem launching Python, I'd think it's safe to delete /Library/Frameworks/Python.framework. Ask me again in a month.
我有点担心whereis python3,whereis pip以及whereis pip3返回什么,但因为没有问题推出的Python,我认为它是安全的删除/Library/Frameworks/Python.framework。一个月后再问我。

