Part 4. Building a Python environment - NOC-MSM/Belize_workshop GitHub Wiki

Part 4. Building a Python environment

With the NEMO and XIOS files obtained, it's time to create a Python environment!

This step is important as the NEMO outputs are netCDF files. This means that the outputs we will obtain can be visualized using specific tools like ncview or IDV, or data analysis tools such as R, MATLAB or Python.

In this workshop, we will use Python 3.7.


Creating a Python environment

Just like before, for this step you will be able to choose between 2 options. Whichever you choose, the result will be the same.

Remember, you have to choose only one of the following options.


  • Option A) Download pre-build executables.
  1. Open your Docker Desktop/Toolbox console.
  2. Download a new Docker environment with Miniconda/Python on it (~3GB download necessary):

docker pull continuumio/miniconda3

docker pull jelt/blz_python:firsttry

  1. Run the Docker environment you just downloaded:

docker run -v $HOME/Belize_workshop:/Belize_workshop -t -i jelt/blz_python:firsttry /bin/bash

  1. Go to your Python diagnostics directory:

cd /Belize_workshop/PYTHON_TOOLS/PYTHON_DIAGNOSTICS

  1. Now you can run diagnostic scripts! Go to the fifth part of this tutorial to continue.

  • Option B) Build your own Python environment
  1. Open your Docker Desktop/Toolbox console.
  2. Go to your Python tools folder inside the Belize workshop folder:

cd $HOME/Belize_workshop/PYTHON_TOOLS

  1. Build a new Docker container for Python (do not forget to add the dot at the end):

docker build -t blz_python .

  1. Run your new Docker container:

docker run -v $HOME/Belize_workshop:/Belize_workshop -t -i blz_python /bin/bash

  1. Go to your Python diagnostics directory:

cd /Belize_workshop/PYTHON_TOOLS/PYTHON_DIAGNOSTICS

  1. Now you can run diagnostic scripts! Go to the fifth part of this tutorial to continue.

Congratulations! You have successfully created a Python environment in a Docker container. Now you can continue to the fifth part of this tutorial!