Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Installing Software in a Lab


Pixi Environments

Use an ASF-provided notebook and pixi.toml to create a Pixi environment

  1. Open the following notebook: /home/jovyan/conda_environments/Create_OSL_Pixi_Environments.ipynb

  2. Run the notebook to select and build one of the available environments.

    • Alternatively, the notebook allows you to point to a custom pixi.toml that you provide.

Install Pixi packages within a running notebook’s environment

The following only works if your pixi.toml file is in the same directory as your notebook. This is not the case for OpenScienceLab provided environments, but can be done through the Custom Environment option in /home/jovyan/conda_environments/Create_OSL_Pixi_Environments.ipynb

  1. Run the following command in a code cell:

!pixi add <package_name>

Install Pixi packages in an existing environment from the terminal

  1. Open a terminal and navigate to where your pixi.toml file is

  2. Run the following command

pixi add <package_name>

Conda Environments

Users can install additional software in isolated Conda environments on their persistent storage volumes with conda or mamba (conda’s faster reimplementation).

OpenScienceLab user images include a default base conda environment with a minimal amount of software installed. Users may create additional conda environments on their persistent user volumes to support workflows in Jupyter Notebooks or Python scripts.

Use an ASF-provided notebook and environment.yml to create a Conda environment

  1. Open the following notebook: /home/jovyan/conda_environments/Create_OSL_Conda_Environments.ipynb

  2. Run the notebook to select and build one of the available environments.

    • Alternatively, the notebook allows you to point to a custom environment.yml that you provide.

Install Conda packages within a running notebook’s environment

  1. Run the following command in a code cell:

%mamba install -c conda-forge <package_name> --yes

Install Conda packages in an existing environment from the terminal

  1. Open a terminal and run the following commands:

mamba activate <environment_name>
mamba install <package_name>

pip

pip is a package installer for Python.

You can install pip packages onto your persistent volume in the following manner:

Install pip packages inside of a Conda environment from the terminal

  1. Open a terminal and use the following commands:

conda activate <environment_name>
python -m pip install <package_name>

Include pip packages in a Conda environment.yml

  1. Include pip in the dependency list

  2. Add a pip section to the bottom of the dependency list in an environment.yaml

name: environment name
channels:
  - conda-forge
dependencies:
  - package_1
  - package_2
  - package_3
  - pip
  - pip:
    - pip_package_1
    - pip_package_2

apt and apt-get

Users cannot install software in OpenScienceLab using apt or apt-get.