以前,我有这个:
$ python # version 2.7.x
$ python3 # version 3.6.x
这工作正常。我犯了一个愚蠢的错误,试图修复一些没有损坏的东西,然后我运行了这些:
brew install python@2
brew install python@3
我在想这会做到这一点:
$ python2 # version 2.7.x
$ python3 # version 3.6.x
但实际上它所做的是:
$ python2 # doesn't exist, damnit
$ python # version 3.6.x
我要寻找的最终结果:
$ python # version 2.7.x
$ python2 # version 2.7.x
$ python3 # version 3.6.x
事实上,如果可能的话,最好在版本 2/3 之间切换 $python
。我如何在 MacOS 上执行此操作?
最佳答案
刚刚做了
brew uninstall python@2
brew uninstall python@3
然后重新运行
brew install python@3
现在:
python --version # => 2.7.x
和
python3 --version # => 3.6.x
关于python - HomeBrew 搞砸了 Python 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49119084/