Skip to article frontmatterSkip to article content

Installing Software in a Lab


Conda Environments

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

OpenSARLab 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.