The easiest way to install Spyder is with the Anaconda Python distribution, which comes with everything you need to get started in an all-in-one package. Download it from its webpage.
For more information, visit our Installation Guide.
If you already installed Spyder on your Windows machine, you do not need to reinstall it on a WSL2-based Linux environment if your code must run there.
Instead, just install Miniconda inside WSL2 and create a new conda environment (or use an existing conda- or virtualenv), then install Spyder-Kernels into that environment with e.g. conda install spyder-kernels. You must manually install ipython_genutils with e.g. conda install ipython_genutils.
conda install spyder-kernels
ipython_genutils
conda install ipython_genutils
Note
Windows creates a network path located at \\wsl$ that points to the partitions of your WSL2 machines, e.g. \\wsl$\Ubuntu-20.04. You must map a network drive letter to your machine path, e.g. W:, for Spyder to correctly see its files and folders.
\\wsl$
\\wsl$\Ubuntu-20.04
W:
To start a Spyder kernel, from your Linux terminal run
python -m spyder_kernels.console --matplotlib="inline" --ip=127.0.0.1 -f=~/remotemachine.json &
It will run the kernel as a subprocess and create a file named remotemachine.json in your WSL home folder.
remotemachine.json
Finally, under the options menu of Spyder’s IPython Console, select Connect to an existing kernel as described in Using external kernels. Insert the absolute path of remotemachine.json into the Connection file field. If you mapped W: as mentioned in above note, the path should be W:/home/username/remotemachine.json. A new console will open in Spyder, running in the Linux environment. Try running os.system('ls -la') and see if it lists your WSL home folder. If you run exit() from Spyder, the kernel running on Linux will be stopped.
W:/home/username/remotemachine.json
os.system('ls -la')
exit()
From the command line (or Anaconda prompt on Windows), run:
conda update anaconda conda update spyder
If this results in an error or does not update Spyder to the latest version, try:
conda install spyder=5
Open the “gear” menu in Spyder’s section under Home in Navigator. Go to Install specific version and select the version of Spyder you want to use. We strongly recommend the latest available, to benefit from new features, bug fixes, performance improvements and usability enhancements.
You can launch it in any of the following ways:
From the command line: Type spyder in your terminal (or Anaconda prompt on Windows).
spyder
From Anaconda Navigator: Scroll to Spyder under Home, and click Launch.
*Windows Only*: Launch it via the Start menu shortcut.
Yes! With Binder, you can work with a fully functional copy of Spyder that runs right in your web browser. Try it here.
Spyder works on modern versions of Windows, macOS and Linux (see the table below for recommended versions) via Anaconda, as well as other methods. It typically uses relatively minimal CPU when idle, and 0.5 GB - 1 GB of RAM, depending on how long you’ve been using it and how many files, projects, panes and consoles you have open. It should work on any system with a dual-core or better x64 processor and at least 4 GB of RAM, although 8 GB is strongly recommended for best performance when running other applications. However, the code you run, such as scientific computation and deep learning models, may require additional resources beyond this baseline for Spyder itself.
Operating system
Version
Windows
Windows 8.1
macOS
High Sierra (10.13)
Linux
Ubuntu 16.04
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.
Activate your conda environment by typing the following in your terminal (or Anaconda Prompt on Windows):
conda activate <ENVIRONMENT-NAME>
Then, type spyder to launch the version installed in that environment.
The first approach for installing a package should be using conda. In your system terminal (or Anaconda Prompt on Windows), type:
conda install <PACKAGE-NAME>
If your installation is not successful, follow steps 3 through 5 of Part 2 in our video on solving and avoiding problems with pip, Conda and Conda-Forge.
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. Here, select the option Use the following Python interpreter, and use the dropdown below to select your preferred environment. If its not listed, use the text box or the Select file button to enter the path to the Python interepreter you want to use. See the IPython Console for more information.
Click Restart kernel in the Consoles menu for this change to take effect.
Watch our video on using additional modules or follow the instructions below it.
If you want to use other modules in Spyder that don’t come with our installer, you need to install Miniconda (only if you don’t have Anaconda or Miniconda yet!). For Spyder to recognize it, the installation should be done in one of the following default paths:
C:\Users\<username>\Anaconda
/Users/<username>/opt/anaconda
C:\Users\<username>\Miniconda
/Users/<username>/opt/miniconda
C:\Users\<username>\Anaconda3
/Users/<username>/opt/anaconda3
C:\Users\<username>\Miniconda3
/Users/<username>/opt/miniconda3
C:\Anaconda
/opt/anaconda
C:\Miniconda
/opt/miniconda
C:\Anaconda3
/opt/anaconda3
C:\Miniconda3
/opt/miniconda3
C:\ProgramData\Anaconda
C:\ProgramData\Miniconda
C:\ProgramData\Anaconda3
C:\ProgramData\Miniconda3
Then, you need to create a new conda environment with the modules that you want to use with Spyder and include spyder-kernels in it. For example, if you want to use scikit-learn, open your terminal or the Anaconda prompt on Windows and run the following commands:
spyder-kernels
scikit-learn
conda create -n spyder-env -y conda activate spyder-env conda install spyder-kernels scikit-learn -y
Finally, you need to connect Spyder to this environment by changing Spyder’s default Python interpreter. To do this, 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. Here, select the option Use the following Python interpreter, and use the dropdown below to select your preferred environment. If it is not listed, use the text box or the Select file button to enter the path to the Python interpreter you want to use.
Your new environment will only be listed here if you installed Miniconda (or Anaconda) in the default path as shown in the table above.
Either use the Reset Spyder to factory defaults under Tools in Spyder’s menu bar, the Reset Spyder settings Start menu shortcut (Windows), or run spyder --reset in your system terminal (Anaconda prompt on Windows).
spyder --reset
Under General in Spyder’s Preferences, go to the Advanced settings tab and select your language from the options displayed under Language.
To create a cell in Spyder’s Editor, type #%% in your script. Each #%% will make a new cell. To run a cell, press Shift-Enter (while your cursor is focused on it) or use the Run current cell button in Spyder’s toolbar.
#%%
Spyder plugins are available in the conda-forge conda channel. To install one, type on the command line (or Anaconda Prompt on Windows):
conda-forge
conda install -c conda-forge <PLUGIN>
Replace <PLUGIN> with the name of the plugin you want to use. For more information on a specific plugin, go to the its repository:
<PLUGIN>
spyder-unittest
spyder-terminal
spyder-notebook
spyder-memory-profiler
spyder-line-profiler
Check the option Remove all variables before execution in the Configuration per file… dialog under the Run menu.
Select the appropriate option in the Configuration per file… dialog under the Run menu.
Go to Preferences and select the theme you want under Syntax highlighting theme in the Appearance section.
You should first follow the steps in our troubleshooting guide. If you can’t solve your problem, open an issue by following the instructions in our Submit a Report section.
First, make sure the error you are seeing is not a bug in your code. To confirm this, try running it in any standard Python interpreter. If the error still occurs, the problem is likely with your code and a site like Stack Overflow might be the best place to start. Otherwise, start at the Basic First Aid section of our troubleshooting guide.
If nothing is displayed in the calltip, hover hint or Help pane, make sure the object you are inspecting has a docstring, and try executing your code in the IPython Console to get help and completions there. If this doesn’t work, try restarting PyLS by right-clicking the LSP Python label item in the statusbar at the bottom of Spyder’s main window, and selecting the Restart Python Language Server option.
For more information, go to the Completion/help not working section in the Common Illnesses page of our troubleshooting guide.
First, make sure your version of Spyder-Kernels is compatible with that of Spyder. See the table in the Spyder-Kernels not installed/incompatible section of the troubleshooting guide to check.
To install the right version, type the following on the command line (or Anaconda Prompt on Windows)
conda install spyder-kernels=<VERSION>
For more information, go to the Errors starting the kernel section in the Common Illnesses page of our troubleshooting guide.
Spyder is in the final stages of being updated for full compatibility with macOS 11 Big Sur, which will be released by the end of 2020 as part of version 4.2.1. However, you can get it working right now with the workaround below. Make sure you have the Anaconda or Miniconda distribution installed, and run the following commands in the Terminal to install Spyder from Conda-Forge in a clean environment:
conda create -n spyder-dev python=3 conda activate spyder-dev conda install -c conda-forge spyder
Then, whenever you want to start Spyder, run the following from the Terminal:
conda activate spyder-dev export QT_MAC_WANTS_LAYER=1 spyder
Spyder is 100% free and open source; there is no paid version or prohibition on commercial use. It is developed by its international user community, and supported by its users through OpenCollective and by its generous sponsoring organizations, including Quansight and NumFOCUS. Our source code, standalone installers and most of our distribution methods (Pip/PyPI, Linux distros, MacPorts, WinPython, etc) can be freely redistributed, used and modified by anyone, for any purpose, including commercial use. For more details about the situation with Anaconda, see that question.
If you use Spyder with the Anaconda distribution, they recently changed their Terms of Service to add restrictions on large (> 200 employee) for-profit companies using Anaconda on a large scale. However, these terms only apply to the package infrastructure (the full Anaconda distribution and the defaults conda channel). Instead, you can simply download the similar Miniforge distribution, which is 100% open source and identical to full Anaconda (aside from not bundling the Python packages installed by default in the Anaconda base environment, which we recommend you avoid using anyway given any problems here can break your whole installation). Then, simply install the packages you need (including Spyder, if you aren’t using our recommended Standalone installers) with conda as you usually do. Miniforge will automatically use the community-maintained Conda-Forge repository, which has a much wider variety of packages and is generally more up to date than the Anaconda equivalent, in addition to being free of any commercial restrictions. For more, see our Installation Guide.
defaults
base
conda