Installation and execution#
In this workshop we will use the Anaconda Python distribution to simplify the installation and execution. We will also focus on Jupyter tools and computational notebooks (see here, too), interacting with Python code via the JupyterLab application (see also here for a more detailed guide).
Istalling Anaconda in your computer
Follow these instructions. The videos are somewhat dated, so the screenshots may look a bit different from what you will actually see during installation. But the steps are the same. Here is a more up-to-date, short installation video, for Windows only.
Running JupyterLab#
We will use the Anaconda Navigator to launch JupyterLab. It’s included in the Anaconda installation, together with JupyterLab itself and many other applications and packages.
The wider world of Python installation and development#
There are many options to install Python and software to develop and execute Python code! The second paragraph in this page is a very brief overview.
Yes, this can be pretty confusing!
Python itself can be installed directly from the official Python website, https://python.org. The installer includes Python, the ability to execute code at the “terminal”, and a very simple “Integrated Development Environment” (IDE) called IDLE.
An initial choice one has to make is the Python version. Typically it’s best to avoid the very latest versions, and choose a slightly but more stable and more widely supported version. Today, that’s probably Python 3.10.
Anaconda is based on the open-source conda package management system. conda itself can be installed through different distributions, with different pros and cons. The other main distrubutions are miniconda
, mamba
and mambaforge
. I never use the Anaconda distribution myself! The source of the packages also varies; the most widely used one in the scientific and other communities is conda-forge.
We will use JupyterLab and Jupyter notebooks. But as everything Jupyter is also open source, the ability to run Jupyter notebooks is also implemented in other software. For example, Visual Studio Code (VSCode), Spyder and PyCharm (PyCharm is not open-source but is freely available for education).
For complex software development tasks, IDE’s are practically necessary. These include VSCode, Spyder and PyCharm. Typically you will write Python code directly (*.py
files) rather than Jupyter notebooks; or some combination. Out of these IDE’s, Spyder probably resembles the Matlab interface the most. VSCode has the advantage of also being a powerful, generic text editor. IDE’s provide lots of conveniences that make coding more efficient.
You can also write code (not Jupyter notebooks) directly, “by hand”, using a simple text editor; then run the code at the terminal. This is helpful in a pinch but pretty inefficient.
Simple, no-fuss options for continued learning#
If you’d like to polish, practice and extend your understaing of core Python language features, I recommend one of these two no-fuss options:
Thonny, a straightforward desktop software that also installs Python for its own use. Simple installation, few distractions, and helpful tools.
Online Python execution sites. There are many options, but this one looks good: https://www.online-python.com
These are great resources for initial learning, but not for Python code development for actual, more complex work.