问题描述
每次打开终端时,都会显示以下代码行。
The below lines of code show up every time I open my terminal.
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
ImportError: No module named conda
的模块我担心我可能损坏了我的(基本)康达环境,但到目前为止我还没有遇到任何问题。主要是,这真让人讨厌。
I am worried I have possibly corrupted my (base) conda environment but I haven't run into any issues so far. Mainly, it's just really annoying to see.
使用 conda激活基数
没有错误。截至最近,我要做的就是删除并重新安装不同版本的opencv,以便拥有一个可以使用imshow()的版本。我也做了 path_to_env_python -m pip3安装常用
。除此之外,我认为我没有做任何会导致此问题的事情。
Using conda activate base
gives no errors. All I was doing as of recently was removing and reinstalling different versions of opencv so that I would have a version that allows me to use imshow(). I also did path_to_env_python -m pip3 install common
. Besides that I don't think I have done anything that would cause the issue.
有什么想法吗?
推荐答案
存在相同的问题。对我来说,一个临时的解决方法是注释掉eval及其bashrc中的else if循环。
Having the same issue. For me a temporary fix was commenting out the eval and its else if loop in bashrc.
conda的github上有一个关于此问题的线程:
There is a thread on this issue on the github of conda:https://github.com/conda/conda/issues/9505
编辑:这是一个错误在4.8.0 anaconda中。在< conda_install> /etc/bash_completion.d/conda
中,调用python时未添加指向蟒蛇的路径,结果打开了python 2.7,然后尝试了进口康达。最新更新已修复此问题,因此运行 conda更新conda
应该可以解决此问题!
edit: It was an error in 4.8.0 anaconda. In <conda_install>/etc/bash_completion.d/conda
python was called without adding the path towards the anaconda python, with as a result that it opened python 2.7 and then tried to import conda. It has been fixed by the most recent update, so running conda update conda
should fix the issue!
这篇关于打开终端时导入conda错误回溯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!