新装Python3.9找不到Jupyter notebook或其他模块

Newly installed Python 3.9 can't find Jupyter notebook or other modules

我注意到我现在已经安装了 Python 3.9(它发生在过去的 2 周内,虽然我不确定如何安装)但现在我无法 运行 软件包像 Jupyter 或 Flask,我曾经能够做到。我还安装了 Python 3.7。当我尝试 运行 他们时,我得到:

-bash: /usr/local/bin/jupyter: /usr/local/opt/python/bin/python3.7: 错误的解释器: 没有那个文件或目录

我也试过重新安装它,但我仍然得到与上述相同的错误。有人知道这里发生了什么吗?

听起来像是某种腐败。你可以试试下面这个吗?

rm '/usr/local/bin/jupyter'
brew install jupyter
brew link --overwrite jupyter
brew link --overwrite --dry-run jupyter
brew unlink jupyter && brew link jupyter

老实说,我建议您使用虚拟环境并在其中安装软件包。请停止在您的系统 python.

中安装软件包

我的建议是使用像 miniconda 这样的包管理器,但你可以简单地使用 virtualenv 和 pip 在其中安装你的包。