Search code examples
condaubuntu-18.04gnome-terminal

Import conda error traceback upon opening terminal


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.

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.

Any ideas?


Solution

  • Having the same issue. For me a temporary fix was commenting out the eval and its else if loop in bashrc.

    There is a thread on this issue on the github of conda: https://github.com/conda/conda/issues/9505

    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!