Installation
The best way to install Polars is to do so inside a Python virtual environment.
For this course, we will use a JupyterHub running on a training cluster.
Installing Polars
Personal computer
python -m venv ~/env # Create virtual env
source ~/env/bin/activate # Activate virtual env
pip install --upgrade pip # Update pip
pip install polars # Install Polars
Alliance clusters
Polars wheels are available for Polars (always prefer wheels when possible):
python -m venv ~/env # Create virtual env
source ~/env/bin/activate # Activate virtual env
pip install --upgrade pip --no-index # Update pip from wheel
pip install polars --no-index # Install Polars from wheel
Running Polars for this course
For this course, we will use JupyterLab on a training cluster via JupyterHub—a set of tools that spawn and manage multiple instances of JupyterLab servers.
Log in to JupyterHub
- go to the URL we will give you in class,
- sign in with the username and password we will give you,
- leave OTP blank,
- you don’t need to edit anything in the server options,
- press start.
Note that, unlike other JupyterHubs you might have used (e.g. Syzygy), this JupyterHub is not permanent and will be destroyed at the end of this course.
If you don’t need all the time you asked for after all, it is a great thing to log out (the resources you are using on this cluster are shared amongst many people and when resources are allocated to you, they aren’t available to other people. So it is a good thing not to ask for unnecessary resources and have them sit idle when others could be using them).
To log out, click on “File” in the top menu and select “Log out” at the very bottom.
If you would like to make a change to the information you entered on the server option page after you have pressed “start”, log out in the same way, log back in, edit the server options, and press start again.
Start a Python notebook
To start a Jupyter notebook with the Python kernel, click on the button “Python 3” in the “Notebook” section (top row of buttons).