What is Spyder?
Spyder is an interactive python environment. It is a graphical user interface (GUI) where you can write, run your code and view output such as plots, text and data tables in one place.
The easiest way to install it is by using conda (see the post what is conda and why use it? for more)
Setting up a conda environment for Spyder
Step 1: Create the conda environment for spyder and install some useful modules:
conda create -n spyder-env python=3.9 numpy scipy pandas matplotlib sympy cython spyder -c conda-forge
Step 2: Activate the conda environment
conda activate spyder-env
Step 3: Launch the Spyder GUI by typing spyder
into the command terminal.
spyder
Navigating the Spyder GUI
Spyder opens with a blank python script for you, note that Python scripts have the .py extension. It should look something like the screenshot below:

Before we start, save the .py file as something like ‘examples_python.py’
At the top of your blank script will be the ‘shebang line‘ this line defines the location of the python interpreter to use and placing it here at the top of your script allows the script to be run without having to type ‘python‘ in the terminal.
#!/usr/bin/env python3
Next, we see a line that specifies the type of utf coding, UTF-8 stands for ‘unicode transformation format’ where 8-bit values are used in the encoding, this is the default method used by Python to turn characters into bytes (you can read more about it here.
# -*- coding: utf-8 -*-
Next we can see some information Spyder has added, namely the date and time that the examples_python.py script was created and the name of the script author:
"""
Created on Sun Feb 26 22:01:38 2023
@author: yourname
"""
Note that anything in between the two sets of triple quotes “”” or anything that comes after # symbol is essentially invisible to the Python interpreter, this is also called ‘commenting out’.
For now we will stick with the basics of the Spyder GUI, on the left hand side is the script panel where you can write your code, at the top is the ‘play’ button that you press to run or ‘execute’ your code. To the bottom right is the IPython console where anything you print using the print() function will be displayed.
