我刚刚将我的 macOS 更新为 Catalina,但我无法再从终端运行 python 或打开 jupyter notebook。例如,我在运行 python 代码时收到错误消息“ImportError: No module named pandas”,然后我得到
zsh:找不到命令:jupyter
跑步时
jupyter notebook
Run Code Online (Sandbox Code Playgroud)
这个问题让我想到了 anaconda(我很想有人解释我为什么。python 需要运行 anaconda 吗?)。我尝试了来自https://github.com/ContinuumIO/anaconda-issues/issues/10998 的几个建议,例如我尝试将文件夹“anaconda3”从“Relocated items”文件夹复制到“Users//”,然后
export PATH=''/Users/<username>/anaconda3/bin:$PATH"
Run Code Online (Sandbox Code Playgroud)
但我得到了
引用>
或者
zsh:/Users//Applications/anaconda3/bin/conda:错误的解释器:/anaconda3/bin/python:没有这样的文件或目录
然后,我按照 anaconda 团队 ( https://www.anaconda.com/how-to- ) 的建议,尝试使用图形安装程序(来自https://www.anaconda.com/distribution/#macos)重新安装 Anaconda restore-anaconda-after-macos-catalina-update/)(我将安装位置更改为我在 /Users// 中创建的文件夹)但在运行 python3 或 jupyter notebook 时我仍然收到相同的错误消息。
如何使用 macOS Catalina 成功运行 python 和 jupyter notebook?