我在使用自制软件升级python3时遇到了一致的问题。
当我运行" brew upgrade python3"时,我得到了
==> Upgrading 1 outdated package, with result:
python3 3.6.5
==> Processing python3 formula rename to python
==> Unlinking python3
==> Temporarily unlinking python
Error: Error occurred while migrating.
No such file or directory @ realpath_rec - /usr/local/opt/python
Backing up...
Error: No such file or directory @ realpath_rec - /usr/local/opt/python
==> Upgrading python3
Error: No such file or directory @ realpath_rec - /usr/local/opt/python
尽管升级失败,但它有破坏我的python3符号链接的副作用,所以我必须运行" brew link python3"之后再次使用它。这个错误也搞砸了依赖于python的其他软件包的brew安装,所以它变得非常糟糕。有人可以帮我解决吗?
编辑:我试过" brew uninstall python"和" brew install python"但我明白了:
~$ brew uninstall python
Warning: Use veclibfort instead of deprecated homebrew/science/veclibfort
Uninstalling /usr/local/Cellar/python/2.7.14... (3,614 files, 50.6MB)
Error: No such file or directory @ realpath_rec - /usr/local/opt/python
~$ brew install python
==> Processing python3 formula rename to python
==> Unlinking python3
==> Temporarily unlinking python
Error: Error occurred while migrating.
No such file or directory @ realpath_rec - /usr/local/opt/python
Backing up...
Error: No such file or directory @ realpath_rec - /usr/local/opt/python
Error: python 2.7.14 is already installed
To upgrade to 3.6.5, run `brew upgrade python`
答案 0 :(得分:0)
我遇到了一个问题:Error: Not a directory @ dir_s_rmdir - /usr/local/Cellar/python3
。
尝试卸载python3
$ brew uninstall python3
尝试安装python
$ brew install python
尝试链接python3
$ brew link python@3.8
Linking /usr/local/Cellar/python@3.8/3.8.5...
Error: Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
rm '/usr/local/bin/2to3'
To force the link and overwrite all conflicting files:
brew link --overwrite python@3.8
To list all files that would be deleted:
brew link --overwrite --dry-run python@3.8
按照提示操作,删除2to3
$ rm '/usr/local/bin/2to3'
链接python@3.8
$ brew link --overwrite python@3.8
修复错误