Homebrew brew doctor warning about /Library/Frameworks/Python.framework, even with brew's Python installed

て烟熏妆下的殇ゞ 提交于 2019-11-28 16:09:31
SherMM

I had the same problem. When I upgraded python3 through Homebrew, I started getting this:

-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 overwrite and everything is working fine now. There is some info about what to do with the Python version in the /Library/Framework/Python.framework here.

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.

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.

Mike

I also received this message.

Something, sometime installed

/Library/Frameworks/Python.framework

on my machine (the folder date was about 4 years old).

I've chosen to remove it.

Please note that the Apple provided framework lives in

/System/Library/Frameworks/Python.framework/

per this thread, enter this command:

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.

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

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 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.

I had installed Python 3 from Homebrew and then another Python 3 directly from the Python website.

I deleted /Library/Frameworks/Python.framework. I did not add any PATH or PYTHONPATH variables in .bash_profile. Then I checked the following in the 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 pip3 returned 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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!