mac卸载python3.8_如何使用Homebrew在Mac上默认设置Python3.8?

I have updated my python 3 to the latest version 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

But when I check the python3 version on my mac it still shows 3.7:

python3 --version

Python 3.7.6

how can I default python3 to the latest 3.8 version using Homebrew ?

Edit:

When I tried to use brew switch, it tells me I only installed python 3.7.6, but with last brew upgrade I'm pretty sure that python3.8.1 is installed with 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

解决方案

Here is the solution:

$ 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"

I will stick to python (v3.7.6) at this time and wait for seamless upgrade of v3.8.1 in the future releases.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值