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¶
- Open the following notebook:
/home/jovyan/conda_environments/Create_OSL_Conda_Environments.ipynb
- 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.
- Alternatively, the notebook allows you to point to a custom
Install Conda packages within a running notebook’s environment¶
- 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¶
- 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¶
- 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
¶
- Include
pip
in the dependency list - Add a
pip
section to the bottom of the dependency list in anenvironment.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
.