macOS 下解决 python: No such file or directory 的办法

故障描述:

macOS 系统,安装了 brew,使用 brew update 更新了 python,运行 python 的时候显示“python: No such file or directory”。

解决办法:

解决 python: No such file or directory 的办法

先用 which python3 查看 python3 的位置,比如我的位置在 /opt/homebrew/bin/python3,然后创建一个软链接到该位置:

ln -s /opt/homebrew/bin/python3 /opt/homebrew/bin/python

然后在终端输入 python -V,如果正确显示 python 的版本信息,那说明此问题得到解决。

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>