我已经将python 3更新到最新版本3.8:
brew search python
==> Formulae
app-engine-python gst-python python ✔ [email protected] ✔
boost-python ipython python-markdown wxpython
boost-python3 micropython python-yq
==> Casks
awips-python kk7ds-python-runtime mysql-connector-python
但是当我在Mac上检查python3版本时,它仍然显示3.7:
python3 --version
Python 3.7.6
如何使用Homebrew将python3默认设置为最新的3.8版本?
编辑:当我尝试使用时brew switch
,它告诉我我仅安装了python 3.7.6,但最后brew upgrade
我确定python3.8.1
已与Homebrew一起安装
brew switch python 3.8.1
python does not have a version "3.8.1" in the Cellar.
python's installed versions: 3.7.6_1
好的,感谢来自Homebrew社区讨论的@gromgit(https://discourse.brew.sh/t/how-to-default-python-3-8-on-my-mac-using-homebrew/7050)
解决方法如下:
$ brew info [email protected]
[email protected]: stable 3.8.1 (bottled) [keg-only]
...
==> Caveats
Python has been installed as
/usr/local/opt/[email protected]/bin/python3
...
[email protected] is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have [email protected] first in your PATH run:
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
For compilers to find [email protected] you may need to set:
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
For pkg-config to find [email protected] you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"
我现在将坚持使用python
(v3.7.6),并等待将来版本中v3.8.1的无缝升级。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句