我不明白这里发生了什么事。我在Mac上。当我运行/usr/local/bin/python3
或 时/usr/local/bin/python3.8
,出现No such file or directory
错误。你知道这里会发生什么吗?
ls -l 的输出:
-rwxr-xr-x 1 admin 246 Oct 24 2019 ipython3
lrwxr-xr-x 1 admin 38 Aug 11 17:25 python3 -> ../Cellar/[email protected]/3.8.5/bin/python3
lrwxr-xr-x 1 admin 45 Aug 11 17:25 python3-config -> ../Cellar/[email protected]/3.8.5/bin/python3-config
lrwxr-xr-x 1 admin 40 Aug 11 17:25 python3.8 -> ../Cellar/[email protected]/3.8.5/bin/python3.8
lrwxr-xr-x 1 admin 47 Aug 11 17:25 python3.8-config -> ../Cellar/[email protected]/3.8.5/bin/python3.8-config
答案1
这些符号链接很可能指向不退出的文件。可能 Homebrew 将 Python 升级到了 3.8.6,但由于某种原因没有更新符号链接。
要修复,请尝试:
brew unlink [email protected] && brew link [email protected]
如果这不能解决问题,请尝试:
brew reinstall [email protected]