【发布时间】:2018-12-23 03:25:44
【问题描述】:
遇到问题我不知道如何解决: 安装了 VS Code,并使用 Homebrew 安装了 Python 3.7,然后安装了 Anaconda - 提供了将其安装到我的用户主页的选项,并选择了该选项。
但是,当我启动终端或 VS Code 时,我遇到了这个错误 - 我可能错过了什么?
Last login: Sat Dec 22 22:04:18 on ttys000
Traceback (most recent call last):
File "/Users/<myusername>/anaconda2/bin/conda", line 7, in <module>
from conda.cli import main
ImportError: No module named conda.cli
(运行 Sierra 的 Mac)
我尝试了以下方法:
export PYTHONPATH="$HOME/.miniconda2/lib/python2.7:$HOME/.miniconda2/lib/python2.7/site-packages:$PYTHONPATH"
并且这些路径似乎确实包括 Anaconda 的路径。 Python 表明 Anaconda 也存在:
Python 3.7.1 (default, Dec 14 2018, 13:28:58)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
我确定我在某处遗漏了一个细节,但不确定是什么。
【问题讨论】:
-
请输入“which python”并让我们知道结果并将其包含在评论中。
-
您好 jmh 21,感谢您回复我。这是请求的输出: My-MacBook-Pro:~
$ which python /Users/ /anaconda3/bin/python -
错误输出中的anaconda2与python输出中的anaconda3之间的差异似乎是罪魁祸首。