You are here: Home / Systems / Mistral / Programming / Python environments

Python environments

Python is increasingly popular in a scientific environment thanks to its wide selection of well maintained modules or packages. On mistral we provide several options ranging from quick usage with a set of predefined modules up to highly customized environments for very specific requirements.

Standard Python installations

These Python installations offer a stable set of installed modules. Existing modules will not be upgraded unless severe security problems need to be addressed. We will install new modules only if their dependencies can be met by already installed versions.

Right now, one of three installations can be activated with the module load command

python/2.7.12  python/2.7-ve0 python/3.5.2

From time to time we start new installations with a recent Python to make more up-to-date modules available.


Anaconda is a python distribution and package manager. It works best with the bash shell but there is also some support for tcsh and some other shells.

System wide installation

To load the desired anaconda module you might have to unload/remove conflicting modules first

module unload anaconda2 anaconda3 netcdf_c
module load anaconda3/bleeding_edge

As for the standard Python installations we offer two Anaconda versions based either on Python 2.7 or 3.6. We update these packages on a regular basis in the bleeding edge conda environment. This means that your script can break over time because more recent and potentially incompatible versions of packages have been installed.

This being conda means you can also create your own environments where you have full control over your packages. There are a few things to consider, though.

Conda installs new environments and keeps its package cache in your home directory. This is probably not what you want since your quota on home is very limited. So the first thing to do is to tell conda that environments should be located on work. You have to decide which project's work to use. There can be several locations but new environments are always created in the last addition.

conda config --add envs_dirs '/work/ux9999/u123456/conda_envs'

Then you can start your own environment

conda create -n my_env dask distributed xarray

Activate your environment after all packages got installed

source activate my_env

One drawback of using a system wide conda is that the package cache still resides in your home directory. We don't know of any way to change that. Therefore you should clean the cache after installing many new packages

conda clean --all

You can ignore the errors when conda tries to clean the system package cache.

More information on anaconda can be found on the anaconda documentation page

Individual miniconda installation

Using the system wide conda has some drawbacks like having the package cache always in your home. An individual conda installation gives you full control over every aspect of anaconda while not using much more space than creating your own environment with the system conda.

First download the latest 64-bit bash installer for Linux

Run the installer on mistral like so

bash ./

Be sure to change the installation path to a project work directory, e.g.


You can let the installer modify your .bashrc or do it yourself.

Once miniconda's conda is available in your shell, you can start creating environments as described for the system wide version above (no need to change envs_dirs). The package cache is now located in miniconda's installation directory on work.

Please do not install any additional software into your base environment. Use dedicated environments for this. Otherwise the software in the conda base environment can interfere with system software. This is critical during startup of the desktop environment on the visualization nodes. If you get an error like "Could not connect to session bus: Failed to connect to socket..." when connecting with VNC to a visualization node, then the dbus-daemon in your conda base environment interferes. Either uninstall dbus from your base environment or remove your local conda initialization from your .bashrc.

Document Actions