Martin Eberlein

Martin Eberlein - Researcher in Software Engineering

Martin Eberlein is a doctoral researcher at Humboldt-Universität zu Berlin.

Mail:  martin.eberlein@hu-berlin.de
Google Scholar:  martin-eberlein
Linkedin:  Martin Eberlein
GitHub:  martineberlein

Photo taken on an expedition to antarctica.

Hosted on GitHub Pages — Theme by orderedlist

16 January 2023

How-To: Install any Python Version on HU-Cluster

by Martin Eberlein

You decided to run your latest research software tool not locally on your outdated windows pc but instead on the mighty Humboldt-Universität Berlin Compute Cluster? Good Choice! These powerful machines provide the perfect environment to test, build and develop your latest and greatest tools!

However, your tool is most likely dependent on other software and resources that need to be installed. Unfortunately: Since you are sharing these machines with all other computer science students (and employees), root privileges (to install your dependencies) are only given to a handful of individuals. But your due date is tomorrow, and you really need to run and finish these last experiments.

So what can you do?

Help is here, at least if you depend on different python versions. In this quick tutorial, I show you how you can install, update, and quickly change between your favorite python versions.

[Note] Connecting to the HU Compute Cluster requires an active Humboldt-University account or an account from the computer science department. If you don’t have an account, you might still find the pyenv instructions helpful; thus, you might want to skip the next section.

Connect to the HU-Cluster

With your local Linux or macOS machine, you can access the server via SSH: Open your terminal with the following command:

ssh -l <hu_cs_account> <server>.informatik.hu-berlin.de

where:

  1. <hu_cs_account> is the name of your Computer Science Account

  2. <server> is the server you want to connect to (Find an overview of all possible servers here))

Alternatively, you can also connect with your general HU account <hu_account> via email:

ssh -l <hu_account>@hu-berlin.de <server>.informatik.hu-berlin.de

You can check the current work load here: Overview.

PyEnv

All we need to do is install pyenv - a simple python version manager tool that allows you to easily switch between multiple versions of python. You can even set local or global system-wide python versions.

Install

  1. First, you need to download pyenv:
curl https://pyenv.run | bash

This should automatically install everything along with all dependencies.

  1. Set up your shell environment for Pyenv:

Upgrade note: The startup logic and instructions have been updated for simplicity in 2.3.0. The previous, more complicated configuration scheme for 2.0.0-2.2.5 still works.

The below setup should work for the vast majority of users for common use cases. See Advanced configuration for details and more configuration options.

  1. Restart your shell:
exec $SHELL
  1. Last but not least, validate your installation:
pyenv --version

Commands:

Now that we have installed the latest version, we can finally install the specific python version with the install command:

pyenv install 3.10.9

To list all already installed versions of python on your system:

pyenv versions

Use the global command to set a specific python version as global (system-wide).

pyenv global 3.10.9
# (Note that you have to install the desired version first with the `install` command)

And to set a specific python version locally (project-based), you can use the local command.

pyenv local 3.10.9

Congratulations!

Congratulations, you did it!

Now you have everything you need! So buckle up, pull that all-nighter, and finish your experiments; it’s about time!

tags: popular - server