我在Mac(Mojave OSX 10.14)上,但我承认我的Python环境非常混乱.
最近,我遇到了多个错误,例如:
zsh: /usr/local/bin/pip: bad interpreter: /usr/local/opt/python/bin/python3.6: no such file or directory
zsh: /usr/local/bin/alembic: bad interpreter: /usr/local/opt/python/bin/python3.6: no such file or directory
zsh: /usr/local/bin/pytest: bad interpreter: /usr/local/opt/python/bin/python3.6: no such file or directory
即使创建并输入其中的virtualenv也是如此.
在这种情况下,我需要一个python3虚拟环境.
当我在环境之外使用哪个python时,得到/usr/local/bin / python和python -v = Python 2.7.15
在此virtualenv之外,我得到了这些错误的解释器错误.
我使用virtualenv -p python3 .venv为python3创建了virtualenv
甚至没有安装任何东西,我仍然得到
zsh: /usr/local/bin/alembic: bad interpreter: /usr/local/opt/python/bin/python3.6: no such file or directory
zsh: /usr/local/bin/pytest: bad interpreter: /usr/local/opt/python/bin/python3.6: no such file or directory
如果我pip卸载alembic和pip3卸载alembic,我仍然会得到错误的解释器错误.
我不知道它可能仍会安装在哪里,也不确定如何清理环境.想要重新开始,但我不知道是否有可能.
最佳答案