我似乎丢失了在我的 Mac 上安装的所有 Python 包。
我输入了以下命令以从 Python 3.6 升级到 Python 3.7:
brew upgrade python
现在当我在终端中输入 ipython3
时,它会显示:
-bash: /usr/local/bin/ipython3: /usr/local/opt/python/bin/python3.6: bad interpreter: No such file or directory
但是在进行brew升级之前,我能够使用ipython3
。此外,我认为我已经失去了所有的Python包,因为当我在Python3中导入模块时,它会显示:
ModuleNotFoundError: No module named *examplepythonpackage*
我之前安装的Python包都丢失了,我需要逐个重新安装吗?
我也无法在Bash终端中运行ipython3
命令。
-bash: /usr/local/bin/ipython3: /usr/local/opt/python/bin/python3.6: bad interpreter: No such file or directory
供参考:
$ which python
/usr/bin/python
$ which python3
/usr/local/bin/python3
$ pip --version
pip 18.1 from /Library/Python/2.7/site-packages/pip-18.1-py2.7.egg/pip (python 2.7)
$ pip3 --version
pip 18.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)