Installing a Python distro for testing and development

From CSDMS
Revision as of 15:08, 30 December 2016 by Mpiper (talk | contribs) (Create page and start adding content)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Installing Python for testing and development on beach

There are several Python distributions available on beach, but it's often useful to install a separate, local, Python distribution for testing and development. This is a technique used frequently by the CSDMS software engineers; see, e.g., the article Installing a WMT executor. If things go horribly awry, you can just delete the distribution and start over again.

Start by creating an install directory for the Python distribution in your home directory. I'll call mine testing.

cd
mkdir testing

Change to the install directory you've selected and define a shell variable, root, for future use.

cd testing
root=$(pwd)

Next, download a Python distribution. The CSDMS software engineers recommend miniconda, a minimal distribution based on the Anaconda Python distribution. We can grab the miniconda installer with curl:

curl https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -o miniconda.sh

Foo.

bash ./miniconda.sh -f -b -p $root/conda
export PATH=$root/conda/bin:$PATH

Use the Anaconda package manager, conda, to install a set of packages used by the executor.

conda install ipython numpy scipy netcdf4