使用自制软件取消链接 python 的问题

Pau*_*aul 0 python macos homebrew unlink python-3.x

我想从我的 Mac 上卸载 python,因为我有一些问题并想重新安装它。

因此,我尝试使用brew unlink python. 但是,当我尝试时,控制台会引发以下错误:

取消链接 /usr/local/Cellar/python/3.7.4... 错误:没有这样的文件或目录@ realpath_rec - /usr/local/opt/python

现在由于上述问题,我无法使用 python,但我也无法重新安装它。我能做什么?

Jak*_*mer 5

符号链接似乎丢失了。转载:

% rm /usr/local/opt/python
rm: remove symbolic link '/usr/local/opt/python'? y

% brew unlink python
Unlinking /usr/local/Cellar/python/3.7.4... Error: No such file or directory @ realpath_rec - /usr/local/opt/python

% brew reinstall  --force python
==> Reinstalling python
Error: python 3.7.4 is already installed
To install 3.7.4, first run `brew unlink python`.
Run Code Online (Sandbox Code Playgroud)

重新创建链接...

% ln -s /usr/local/Cellar/python/3.7.4/bin/python3 /usr/local/opt/python
'/usr/local/opt/python' -> '/usr/local/Cellar/python/3.7.4/bin/python3'
Run Code Online (Sandbox Code Playgroud)

您应该能够取消链接或卸载:

% brew unlink python
Unlinking /usr/local/Cellar/python/3.7.4... 22 symlinks removed

% brew uninstall python
Uninstalling /usr/local/Cellar/python/3.7.4... (3,865 files, 60MB)
Run Code Online (Sandbox Code Playgroud)