Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spyder does not run in Anaconda virtual environment on Windows 10

Tags:

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

like image 816
Andy Jaworski Avatar asked Dec 11 '15 06:12

Andy Jaworski


People also ask

How do I connect Spyder with Anaconda?

Running with Anaconda On other platforms, open Anaconda Navigator, scroll to Spyder under Home , and click Launch . If Spyder does not launch via this method or you prefer to use the command line, open Anaconda Prompt (Windows) or your terminal (other platforms), type conda activate base then spyder .

How do I fix my Anaconda Spyder?

From the Anaconda Prompt/Terminal/command line (on Windows/Mac/Linux), run the command spyder --reset , which will restore Spyder's config files to their defaults, which solves a huge variety of Spyder issues.


1 Answers

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.

like image 172
Mike Müller Avatar answered Oct 22 '22 19:10

Mike Müller