These directions walk through installing miniconda, a lightweight distribution of the python package installer conda, downloading the NAVO workshop material, then creating and testing the custom environment for the workshop.
Miniconda is a free minimal installer for conda. It is a small, bootstrap version of Anaconda that includes only conda, Python, the packages they depend on, and a small number of other useful packages, including pip, zlib and a few others. Note, though, that if you have either Miniconda or the full Anaconda already installed, you can skip to the next step.
Check if Miniconda is already installed.
% conda info
If Miniconda is not already installed, follow these instructions for your operating system: https://docs.conda.io/en/latest/miniconda.html
On Windows, you might also need additional compilers.
Miniconda includes an environment manager called conda. Environments allow you to have multiple sets of Python packages installed at the same time, making reproducibility and upgrades easier. You can create, export, list, remove, and update environments that have different versions of Python and/or packages installed in them. For this workshop, we will configure the environment using the conda command prompt.
On Mac or Linux, the bash
shell will handle the conda commands. Open your terminal and verify your shell environment:
% echo $SHELL
If the output text does not contain bash
, switch to the bash shell before
being able to run anything related to conda.
On Windows, open the Anaconda Prompt
terminal app.
At the prompt opened in the previous step, enter this command to see whether git is already installed and accessible to this shell:
% git --version
If the output shows a git version, proceed to the next step. Otherwise install git by entering the following command and following the prompts:
% conda install git
Download the workshop folder using git:
% git clone https://github.com/NASA-NAVO/navo-workshop
For this workshop, the python version and all needed packages are listed in the environment.yml file.
Navigate to the workshop directory in the terminal. For example, if you installed the navo-workshop directory in your home directory, you could type the following:
% cd navo-workshop
And finally, on any platform, to install and activate the navo-workshop environment, type:
% conda env create --file environment.yml
% conda activate navo-workshop
The name of the new conda environment created above should be displayed next to the terminal prompt:
(navo-workshop) %
Run the check_env.py
script to check the Python environment and some of the
required dependencies:
(navo-workshop) % python check_env.py
From the directory containing the notebooks:
(navo-workshop) % jupyter lab