I installed a fresh version of Python via
brew install python
Also
brew info python
tells me that it is at version 2.7.7.
I seem to remember that the python OSX Mavericks ships with is 2.5. So that
python --version
gives me 2.7.5 makes even less sense.
Also
which python
/usr/local/bin/python
should be the Homebrew version, correct?
I'm lost. Does anybody know, why my Python isn't version 2.7.7?
----------------------------------------------------------------------------------
You have to explicitly tell brew that you want to switch to the version of python you just installed. To do that, type:
brew switch python 2.7.7
in your command line. This may not work if the version you installed is actually 2.7.7_2.
In that case, just replace 2.7.7 with 2.7.7_2 above
and run it again. Once this is done, you'll have to reload your environment to pick up the changes.

本文解决使用Homebrew安装Python版本后版本号显示不正确的问题,通过明确指令来切换使用的Python版本,并强调环境重载以确保版本更改生效。
3217

被折叠的 条评论
为什么被折叠?



