Pauline
Pauline

Reputation: 3836

Python - import error when trying to activate a virtual environment, or lauch Spyder

I get an ImportError whenever I try to activate a virtual environment, or when I try to launch Spyder.

When trying to activate a virtual environment:

Traceback (most recent call last):
File "/home/pauline/anaconda3/bin/conda", line 3, in <module>
from conda.cli import main
ImportError: No module named conda.cli

When trying to open spyder:

Traceback (most recent call last):
File "/home/pauline/anaconda3/bin/spyder", line 2, in <module>
from spyderlib import start_app
ImportError: No module named spyderlib

I tried to find an answer for that but I could mainly find problems occurring after Anaconda was just installed (mine has been installed previously and was working fine up until yesterday).

I have also tried this answer and this answer but they did not solve the problem.

The only think I can think of which may have provoked this error is that I changed the interpreter used by Spyder yesterday from the default Anaconda Python interpreter to an interpreter from a virtual environment created with virtualenv. Even then, I could close and restart Spyder with no problems, and the errors started after I rebooted my computer.

[edit] I should add that both Anaconda and my virtual environment use the same version of Python which is Python 3.5

Upvotes: 0

Views: 928

Answers (1)

elelias
elelias

Reputation: 4761

If you are using a different python version, whatever packages that you had with anaconda or that you may have installed with conda install will not be there on the new version. You need to install them with pip or conda again.

Upvotes: 1

Related Questions