Tac*_*Tau 24 linux macos homebrew python-3.x
我已将我的 python 3 更新到最新版本 3.8:
brew search python
==> Formulae
app-engine-python gst-python python ? python@3.8 ?
boost-python ipython python-markdown wxpython
boost-python3 micropython python-yq
==> Casks
awips-python kk7ds-python-runtime mysql-connector-python
Run Code Online (Sandbox Code Playgroud)
但是当我在我的 mac 上检查 python3 版本时,它仍然显示 3.7:
python3 --version
Python 3.7.6
Run Code Online (Sandbox Code Playgroud)
如何使用 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
Run Code Online (Sandbox Code Playgroud)
好的,感谢来自 Homebrew 社区讨论的@gromgit(https://discourse.brew.sh/t/how-to-default-python-3-8-on-my-mac-using-homebrew/7050)
这是解决方案:
$ brew info python@3.8
python@3.8: stable 3.8.1 (bottled) [keg-only]
...
==> Caveats
Python has been installed as
/usr/local/opt/python@3.8/bin/python3
...
python@3.8 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 python@3.8 first in your PATH run:
echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.bash_profile
For compilers to find python@3.8 you may need to set:
export LDFLAGS="-L/usr/local/opt/python@3.8/lib"
For pkg-config to find python@3.8 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/python@3.8/lib/pkgconfig"
Run Code Online (Sandbox Code Playgroud)
python这个时候我会坚持(v3.7.6),等待后续版本v3.8.1的无缝升级。
| 归档时间: |
|
| 查看次数: |
31153 次 |
| 最近记录: |