Install with pip to Bianca¶
Read through the content below
Which transfer method is the best?
- Use Transit.
- By this you get software modules of python, although with not exactly the same version.
- You'll need a Python module to download the packages.
Check for packages on Bianca¶
With a Python module loaded
- from the Python shell with the
importcommand - from BASH shell with the
pip listcommand
You can also check the content of a module without loading it
ml help python/3.10.8
Is it not there? Then proceed!
Procedures¶
Use transit!
- Log in to transit
- Go to the mounted project folder
- Load Python of desired version (IMPORTANT!)
- Download with
pip download - On Bianca: Load Python of desired version (IMPORTANT!)
- Do
pip install
You may benefit from using a requirements.txt file and virtual environment through python -m venv <environment name>
Transit¶
- Log in to transit:
ssh <username>@transit.uppmax.uu.se - (If not done already) Mount the wharf of your project.
user@transit:~$ mount_wharf sens2025560
Mounting wharf (accessible for you only) to /home/<user>/sens2025560
<user>-sens2025560@bianca-sftp.uppmax.uu.se's password:
- Navigate to your wharf folder
Download on Transit¶
- Be aware of that the module system on Transit is different from Bianca. Typical module name is
Python/3.13.5-GCCcore-14.3.0 - Load the Python version you plan to use. If you need 3.11.X it is sufficient to load a
Python/3.11module, bug fix version matters less. This is to find compatible versions of the package. - Note that Transit only covers Python versions 3.10 and higher.
Table of python version on Transit and Bianca
The table below tells which Python version you should load on Transit to be able to install for Bianca.
| Python version | Bianca | Transit |
|---|---|---|
| 3.9 | 3.9.5 | - |
| 3.10 | 3.10.8 | 3.10.4-GCCcore-11.3.0 |
| 3.11 | 3.11.8 | 3.11.5-GCCcore-13.2.0 |
| 3.12 | 3.12.7 | 3.12.3-GCCcore-13.3.0 |
| 3.13 | 3.13.1 | 3.13.5-GCCcore-14.3.0 |
- Download!
- You should get a
.whlfile
Transit has a newer system compared to Bianca
- A low-level library called GLIBC typicaly follows the OS installation.
- GLIBC version on Bianca is 2.17
- When downloading python packages on Transit you may get packages relying on GLIBC>2.17.
- If you use them on Bianca you may get errors like:
Solution
- add the options
--platform manylinux_2_17_x86_64 --no-depsto thepip downloadcommand- Like
pip download pillow==12.2.0 --platform manylinux_2_17_x86_64 --no-deps
- Like
Interested in requirements files etc?
output
If you have a requirements.txt file already, upload it from local computer via e.g. sftp to Transit.
- Download the python packages to a specific folder. Like
mkdir src_packages
cd src_packages
pip download -r requirements.txt --platform manylinux_2_17_x86_64 --no-deps
--platform manylinux_2_17_x86_64will force the packages to be compatible with Bianca when instaling them there
Installation part on Bianca¶
- Log in to Bianca and the relevant project
- Load the same python version (3.X, 3rd digit does not matter)
- Ex.
ml python/3.11.5
- Ex.
pip install --user --no-index --find-links /proj/sens2025560/nobackup/wharf/$USER/$USER-sens2025560 <package-name>==<version>
-
NOTE: you don't need the full name of the
.whlfile! -
The package ends up automatically in
~/.local/lib/python<version>/site-packages/.
Interested in requirements files?
- Go to the directory where the the requirements file and the downloaded package files are
- Ex:
cd /proj/sens2025560/nobackup/wharf/$USER/$USER-sens2025560
- Ex:
Test it in Python¶
Alternative 1¶
In the bash session, do
Alternative 2¶
- Start a python console
- Import the package with
import <package> - This should give no errors!
Packages with dependencies
- Pandas is a typical packages that relies on specific version of numpy and also some other packages.
- Downloading pandas as source also fetches the dependencies with compatible versions.
Example
$ pip download pandas==2.2.2
Collecting pandas==2.2.2
Using cached pandas-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB)
Collecting numpy>=1.22.4
Using cached numpy-2.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 MB)
Collecting python-dateutil>=2.8.2
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Collecting pytz>=2020.1
Using cached pytz-2026.2-py2.py3-none-any.whl (510 kB)
Collecting tzdata>=2022.7
Using cached tzdata-2026.2-py2.py3-none-any.whl (349 kB)
Collecting six>=1.5
Using cached six-1.17.0-py2.py3-none-any.whl (11 kB)
Saved ./pandas-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Saved ./numpy-2.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Saved ./python_dateutil-2.9.0.post0-py2.py3-none-any.whl
Saved ./pytz-2026.2-py2.py3-none-any.whl
Saved ./tzdata-2026.2-py2.py3-none-any.whl
Saved ./six-1.17.0-py2.py3-none-any.whl
Successfully downloaded pandas numpy python-dateutil pytz tzdata six
Exercise¶
Install numpy-2.1.0 for general use in by you
- You want this in a 3.10 Python version on Bianca.
- Download on Transit using a Python/3.10.X version
- Install on Bianca using a Python/3.10.X version
- Test if it works
- Uninstall this package to not pollute your present general package library!
Answer
- Using Transit and how to navigate to the porject folder is shown above.
- Find a Python version (major, minor) that goes together with the Bianca Python:
ml av python- We can choose between 3.10.4 and 3.10.8. Let's take the newest one and
bareis sufficient for us.
- We can choose between 3.10.4 and 3.10.8. Let's take the newest one and
- Load Python:
ml Python/3.10.8-GCCcore-12.2.0-bare - Download
numpy-2.1.0:pip download numpy==2.1.0
How will that look like?
$ pip download numpy==2.1.0
Collecting numpy==2.1.0
Downloading numpy-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.3/16.3 MB 34.0 MB/s eta 0:00:00
Saved ./numpy-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Successfully downloaded numpy
- Resulting file name:
numpy-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
On Bianca:
ml python/3.10.8
pip install --user --no-index --find-links /proj/sens2025560/nobackup/wharf/$USER/$USER-sens2025560 numpy=2.1.0
- Test it by starting python console and import and check version:
- If it works you can exit the python shell with
CTRL+D - Delete
numpy-2.1.0from your local library
Isolated/virtual environments and requirements files¶
Introduction¶
Note
Isolated environments (venv solve a couple of problems):
- You can install specific package, also older, versions into them.
- You can create one for each project and no problem if the two projects require different versions.
- You can use it as a sandbox to identify which versions go together
- Like finding compatible versions of numpy and pandas
- You can remove the environment and create a new one, if not needed or with errors.
- More information about isolated environments.
You cannot reuse a virtual environment created on Transit on Bianca
- Doing
venvon Transit will point to python with other paths compared to on Bianca. You cannot reuse that specific environment on Bianca. - BUT it can help identify which package versions goes together
Procedure on Transit¶
- Make test environment venv311T with python-3.11 on Transit
module load Python/3.11.5-GCCcore-13.2.0
mkdir test_311
cd test_311
python -m venv venv311T
source venv311T/bin/activate
mkdir src_311
cd src_311
pip install matplotlib/3.9.2
- Make requirements file (should end up in
test_311/src_311folder)
- You may now deactivate the environment:
deactivate - Download and pick GLIBC<=2.17 (they should end up in
test_311/src_311folder)
Procedure on Bianca side¶
- Go to the project folder you want to put your virtual environment.
- Load Python and make a new virtual environment (
venv311B, B for Bianca) for this project on Bianca and activate it
- This should give you the prompt
(venv311B) - Locate the path to the requirements file and the source files for the packages.
- Alt 1: Go to that directory and install there
cd /proj/sens2025560/nobackup/wharf/$USER/$USER-sens2025560/test_311/src_311
pip install --no-index --find-links . -r requirements.txt
- Alt 2: Include the path in the install command
pip install --no-index --find-links /proj/sens2025560/nobackup/wharf/$USER/$USER-sens2025560/test_311/src_311 -r /proj/sens2025560/nobackup/wharf/$USER/$USER-sens2025560//test_311/src_311requirements.txt
- Check with
pip list - You may now deactivate the environment:
deactivate
Exercise 2¶
Follow the steps above
Summary installation principles
- Decide on a Python version to work with on Bianca
Transit
- Log in to Transit
- (If not done already) Mount the wharf of your project.
- Go to project directory
- Load the relevant Python module
- If you need to test versions
- (Make a test isolated environment with
pip -m venv <name of env> - (Install right packages, possibly with pinned versions)
- (freeze the environment and create a requirements file)
- (Make a test isolated environment with
- Download package (you may need to force those to be compatible with the old Bianca system)
pip download <package name>pip download -r <requirements file>
- You will get a
.zipor.whlfile for each package
Bianca
- On Bianca load the relevant python module
- Make the installations from these files in wharf, either
- Recommended: in a virtual environment in your real project folder.
- the installation will end up in the folder of the virtual environment.
- If you know what you are doing: to your local folder
- everytime you start the python module these packages will show up for that version.
- Recommended: in a virtual environment in your real project folder.
Error
If problems arise, send an email to support@uppmax.uu.se and we'll help you.