Software installation

This course is interactive and demonstrates many different tools. Thus, even beyond Python, extra software (Python libraries) needs to be installed. This page contains the instructions.

Once the course starts, we don’t have time to stop for installing software.

Please make sure before the course that you have all the required software installed or some other way access to it. For example, the workshop could be done with a remote Jupyter server, as long as you can use the terminal from the Jupyter (you need to be able to access the command line for some lessons).

Do you need help?

Participants from a partner institution are invited to install help sessions. (Hint: ask your institution to become a partner if it isn’t already!)

Otherwise, if you need installation help, show this page to someone around you and they can probably help. These are relatively standard tools.

Don’t be afraid to ask for help. Installing scientific software is harder than it should be and it helps to have someone guide you through it.

Python

We expect you to have a working Python installation with some common libraries. We currently recommend Miniforge, which includes the base and packages through a different, freely usable channel. You can explore the options in the tabs below.

This is our recommended method - it can be used for any purpose and makes a strong base for the future.

Follow the instructions on the miniforge web page. This installs the base, and from here other packages can be installed.

Miniforge uses the command line - this gives you the most power but can feel unfamiliar. See the command line crash course for an intro.

Starting Python

You need to Python in a way that activates conda/mamba.

Linux/MacOS: Each time you start a new command line terminal, you can activate Miniforge by running. This is needed so that Miniforge is usable wherever you need, but doesn’t affect any other software on your computer (this is not needed if you choose “Do you wish to update your shell profile to automatically initialize conda?”, but then it will always be active):

$ source ~/miniforge3/bin/activate

Python for SciComp software environment

Once Python and conda/mamba are installed, you can use it to install an environment. An environment is a self-contained set of extra libraries - different projects can use different environments to not interfere with each other. This environment will have all of the software needed for this particular course.

This environment file contains all packages needed for the course, and can be installed with. The following command will install an environment named python-for-scicomp (there may be lots of warning messages: this is OK if it still goes through):

$ mamba env create -n python-for-scicomp -f https://raw.githubusercontent.com/AaltoSciComp/python-for-scicomp/master/software/environment.yml

Each time you start a new command line, you need to activate miniforge and this environment:

$ source ~/miniforge3/bin/activate
$ conda activate python-for-scicomp

JupyterLab

We do most of the lessons from JupyterLab (and JupyterLab provides most of the other tools we need).

JupyterLab was instaled in the previous step. To run it, first, start the Miniforge command line interface. Remember, you may need to activate Miniforge and the environment first.

$ source ~/miniforge3/bin/activate
$ conda activate python-for-scicomp
$ jupyter-lab

Verification of Python and JupyterLab

Watch the video

See this verification in video form - if you can do this, you are ready to go for day one. Your exact steps may be a bit different.

Remember that you need to activate the environment first - see the step above.

You can start JupyterLab from the command line:

$ jupyter-lab
(... Jupyter starts in a web browser)

Verify that you can start a Jupyter notebook. We will learn how to do this in day 1, but you can try running print("Hello, world!") if you want.

../_images/jupyterlab-notebook.png

Starting a Jupyter Notebook from JupyterLab.

Text editor

For one portion of the course, you will need a text editor. If you don’t know what to use, you can use the text editor that comes from JupyterLab and it will do everything you need - no extra installation needed.

Other editors

Because we need to be simple in our teaching, we only teach the most basic editors. We encourage you to try out more advanced ones yourself.

For other editors, see the CodeRefinery instructions. You don’t exactly need a terminal editor - the graphical ones, such as VSCode or whatever you use now, will work as well.

Command line

You need access to the command line for some lessons. JupyterLab includes it, so no extra installation is needed. If you want to test in advance:

  • You can start it from JupyterLab (recommended):

    ../_images/jupyterlab-terminal.png

    From the JupyterLab launcher, select “Terminal”.

Other ways to access the command line

  • From the Anaconda Navigator:

    ../_images/anaconda-prompt.png

    From the Anaconda Navigator, you can select “environments” on the left, then click on one, then the arrow, then “Open terminal”.

  • From your operating system’s terminal applications, if you activate Anaconda.

Verification of the command line

To verify command line usage, type the following commands (without the $), and you should see the corresponding output that lists the Python version:

$ python3 -V
Python 3.8.3

## Or python... if it's installed as that
$ python -V
Python 3.8.3

Any recent version of Python 3 should work for the course (for example 3.8 or higher).

Zoom

If this is an online workshop, it might use Zoom. You can see CodeRefinery instructions for it.

Need help?

If you have access, come to one of the installation help sessions. Or, ask your colleagues: these are standard tools and you can definitely find someone can help you get set up!

See also