Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Switch Spyder Environment without installing spyder at each environment

I am using multiple conda environments, and use Spyder as my IDE. These environments often have the same python version, and differ based on installed packages (packages not used by spyder).

I looked how to run spyder in a certain environment, and the answers i found all state that i first have to install spyder in that environment and then run it.

However, this of course requires extra space used on my computer. Is there a way to use spyder in different conda environments, without installing spyder multiple times (or maybe just once per python version)?

Thanks in advance!

like image 899
user3053216 Avatar asked Aug 26 '18 12:08

user3053216


People also ask

How do you switch between Spyder environments?

To work with an existing environment in Spyder, you need to change Spyder's default Python interpreter. To do so, click the name of the current environment in the status bar, and then click Change default environment in Preferences. This will open the Preferences dialog in the Python interpreter section.

How do you use a Spyder Conda environment?

Q: How do I run Spyder installed in a conda environment using Anaconda Navigator? Select the environment you want to launch Spyder from under Applications on. If Spyder is installed in this environment, you will see it in Navigator's Home window. Click Launch to start Spyder in your selected environment.

How do I change my Spyder path in Python?

Press CTRL+SHIFT+ALT+P to open the Preferences window. Within this window, select the Console item on the left, then the Advanced Settings tab. The path to the Python executable will be right there.

How do I change my Spyder kernel?

keyboard shortcut Ctrl + Alt + Shift + P.


2 Answers

As explained in the comments, the quick answer is only to install the spyder-kernel package within the desired conda environment. You don't need to install the whole spyder package again and again.

like image 30
Andrea Bragantini Avatar answered Oct 27 '22 00:10

Andrea Bragantini


(Spyder maintainer here) We added some improvements in our 3.3 versions to help users deal more easily with multiple environments. Please see this blog post for the details, in particular the section called Even more fixes and refinements with Spyder 3.3.1.

Note: A little bug that affects this surfaced after we released 3.3.1, just in case you find that problem too. A fix will be available in 3.3.2, and more improvements on how to handle conda environments are planned for Spyder 4, to be released in 2019.

like image 172
Carlos Cordoba Avatar answered Oct 26 '22 22:10

Carlos Cordoba