Spyder does not run in Anaconda virtual environment on Windows 10

Andy Jaworski picture Andy Jaworski · Dec 11, 2015 · Viewed 28k times · Source

This is my first post here. I tried to find an answer to this question but to no avail.

Just installed Anaconda2 (2.7.11 Python kernel) on my Win10 machine. I am trying to learn the conda command. Here is my problem.

  1. I go to the Anaconda prompt window.
  2. I create a virtual environmant with conda create -n myenv python=3.4 command.
  3. I activate the environment with activate myenv.
  4. When I list the environmants with conda env list it shows as active (star next to it).
  5. When I start python from a command line it shows me that it is running 3.4.
  6. The same with ipython.
  7. When I type spyder it opens the spyder window but shows me 2.7.11. This is confirmed by running print(sys.version).

Am I doing anything wrong or is this just windows 10 problem.

Thanks in advance, Andy

Answer

Mike Müller picture Mike Müller · Dec 12, 2015

When you type spyder, the search for this command begins in the paths that the conda environment created. If it cannot find it there, it will go and search at other places. In your case in the paths of the default Anaconda install. So after you activate your environment:

activate myenv

you need to install sypder inside this environment:

(myenv) conda install spyder   

where (myenv) indicates the active environment.