Spyder
Spyder is a Python integrated development environment (IDE). It allows for editing, debugging, and optimizing Python code and can be used effectively for large projects as well as short Python scripts. It is similar in its layout and functionality to the Matlab GUI and RStudio. Spyder is available on the SCC by loading a python3 module. After loading a python3 module, the version of Spyder that is available can be checked using the pip command. The Spyder IDE can be launched with the spyder command:
scc1% module load python3/3.8.10
scc1% pip list | grep spyder
pyls-spyder 0.4.0
spyder 5.0.1
spyder-kernels 2.0.2
spyder-line-profiler 0.2.1
spyder-memory-profiler 0.2.1
WARNING: You are using pip version 21.1.1; however, version 22.0.4 is available.
You should consider upgrading via the '/share/pkg.7/python3/3.8.10/install/bin/python3.8 -m pip install --upgrade pip' command.
scc1% spyder &
Conda Environments
If you want to install Spyder into a conda environment, first activate your environment and then run:
scc1% conda install spyder
Recommendations
- Use the menu option Run→Configuration per File to control how your Python script is run. This lets you set a working directory for the script, assign command line arguments, and many other options.
- The Project menu lets you create a project. The Spyder documentation describes this in detail. A project makes working with multiple Python files significantly easier.
- The Spyder documentation has a number of short tutorial videos on using Spyder.
- Use the Outline Viewer (enable with the View→Panes→Outline option) to see cells in the script. A cell is created with a comment line that starts with
#%%. Adding these to your script allows you to use the Outline Viewer to quickly navigate around your code.
