简体   繁体   English

终端和VS代码中的Anaconda错误

[英]Anaconda errors in Terminal and VS Code

Running into an issue I'm not sure how to resolve: Installed VS Code, and used Homebrew to install Python 3.7, then installed Anaconda - was given an option to install it to my user home, and chose that option. 遇到问题时,我不确定如何解决:安装了VS Code,并使用Homebrew安装了Python 3.7,然后又安装了Anaconda-已获得将其安装到我的用户主目录的选项,然后选择该选项。

When I start up Terminal or VS Code though, I'm hitting this error - what have I likely missed? 但是,当我启动Terminal或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

(Mac running Sierra) (运行Sierra的Mac)

I've attempted the following: 我尝试了以下操作:

export PYTHONPATH="$HOME/.miniconda2/lib/python2.7:$HOME/.miniconda2/lib/python2.7/site-packages:$PYTHONPATH"

and the paths do appear to include Anaconda's paths. 并且路径确实包含了Anaconda的路径。 Python indicates Anaconda is present as well: 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.

I'm sure I've missed a detail somewhere, but not sure what. 我确定我错过了某个地方的细节,但不确定是什么。

Likely this was a brute-force solution, but running anaconda-clean and then uninstalling anaconda2 and anaconda3, and finally reinstalling anaconda3 appears to have resolved this, since I don't actually need anaconda on Python2.7. 可能这是一个蛮力的解决方案,但是运行anaconda-clean然后卸载anaconda2和anaconda3,最后重新安装anaconda3似乎已经解决了这一问题,因为我实际上在Python2.7上不需要anaconda。 I imagine the correct solution if I needed them both would be to set up additional environments to handle this. 我想如果我同时需要它们,那么正确的解决方案将是设置其他环境来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM