Skip to content

PPUG_create_python_env

Alice Bertini edited this page Oct 23, 2018 · 14 revisions

Setting up the Python virtualenv using create_python_env

The first step in running the CESM post processing code is to setup the virtual environment. This is a one-time setup step required with each download of the CESM post processing code.

In the [POSTPROCESS_PATH] directory, run the following command:

./create_python_env -help

This returns:

SYNOPSIS

   create_python_env [options]

   This script sets up the python virtual environment (env) for a given supported machine.
   This script executes the following steps:
   - loads the python modules for this machine (cheyenne and DAV require module load python/2.7.14)
   - clone the ncar_pylib virtualenv
   - activate env
   - install post-processing tools into the env
   - compile/install additional tools (e.g. zonal_average tool for ocn diag)
   - run unittests
   - deactivate env

OPTIONS

   -machine        specify a CESM supported machine name.
   -help           Print this help message and exit

The mandatory option -machine is the name of a supported machine (currently cheyenne or dav).

Running the create_python_env command creates the cesm-env2 Python virtualenv directory. The post processing scripts that are created by the create_postprocess command activate and deactivate the virtualenv as needed. The user is not required to modify their environment in order to run any of the post processing scripts.

As an alternative to setting up your own virtual environment, NCAR users may choose to use the latest installation of the code by referring to the Cheyenne and DAV Quick Start Guide.

To recreate the virtualenv after changes have been introduced to any of the python code, run the following commands:

make clobber
make clobber-env
./create_python_env -machine [supported-machine-name]
Clone this wiki locally