Environment Modules

Welcome to the Environment Modules open source project. The Environment Modules package provides for the dynamic modification of a user's environment via modulefiles.

What are Environment Modules?

Typically users initialize their environment when they log in by setting environment information for every application they will reference during the session. The Environment Modules package is a tool that simplify shell initialization and lets users easily modify their environment during the session with modulefiles.

Each modulefile contains the information needed to configure the shell for an application. Once the Modules package is initialized, the environment can be modified on a per-module basis using the module command which interprets modulefiles. Typically modulefiles instruct the module command to alter or set shell environment variables such as PATH, MANPATH, etc. modulefiles may be shared by many users on a system and users may have their own collection to supplement or replace the shared modulefiles.

Modules can be loaded and unloaded dynamically and atomically, in an clean fashion. All popular shells are supported, including bash, ksh, zsh, sh, csh, tcsh, as well as some scripting languages such as perl and python.

Modules are useful in managing different versions of applications. Modules can also be bundled into metamodules that will load an entire suite of different applications.

Quick examples

Here is an example of loading a module on a Linux machine under bash.

% module load gcc/6.1.1
% which gcc

Now we'll switch to a different version of the module

% module switch gcc gcc/6.3.1
% which gcc

And now we'll unload the module altogether

% module unload gcc
% which gcc
gcc not found

Now we'll log into a different machine, using a different shell (tcsh).

tardis-> module load gcc/6.3.1
tardis-> which gcc

Note that the command line is exactly the same, but the path has automatically configured to the correct architecture.


There are two versions of the Environment Modules package. A version written in C and a native Tcl version. Both versions use the same kind of modulefiles and command line syntax. There are some differences between the two versions, overall they are very similar.

C version

3.2.10 released on 2012-12-21 (NEWS)

Tcl version

1.923 released on 2017-07-20 (NEWS)


C version
This version requires compilation and linking with the libtcl*.a libraries. You will need Tcl (and optionally TclX - Extended Tcl) installed to compile and install Modules. Information and the Tcl package can be found at ActiveState Corporation.
Tcl version
You must have Tcl and tclsh installed, version 8.4 or newer.

Source repository

Sources of the Environment Modules package are handled with git. Repository can be reached at:




About Modules

About Modules contributed / based tools


Related tools

Flavours is a wrapper built on top of Modules C-version to simplify the organization and presentation of software that requiring multiple builds against different compilers, MPI libraries, processor architectures, etc. This package is written and maintained by Mark Dixon.

Env2 is a Perl script to convert environment variables between scripting languages. For example, convert a csh setup script to bash or the other way around. Supports bash, csh, ksh, modulecmd, perl, plist, sh, tclsh, tcsh, vim, yaml and zsh. This package is written and maintained by David C. Black.

Software Collections is a Red Hat project that enables you to build and concurrently install multiple RPM versions of the same components on your system, without impacting the system versions of the RPM packages installed from your distribution. Once installed a software collection is enabled with the scl command that relies on Modules for the user environment setup.

The OSCAR Cluster Project uses modules along with a tool called switcher. Read about switcher and modules in section 4.11 of the OSCAR Cluster User's Guide.

Reference installations

The NERSC - The National Energy Research Scientific Computing Center has a great introduction and help page: Modules Approach to Environment Management.

The University of Minnesota CSE-IT manages software in Unix using Modules. They give some insight of their Modules usage and provide details on the way they have setup their Modules environment.


Mailing list

Questions or comments for the Modules community can be sent to the modules-interest mailing list by using the email address modules-interest@lists.sourceforge.net. Suggestions and bug reports for Modules or this web site may also be sent to this mailing list.

The mailing-list archive is publicly available. Click here to subscribe. You can change your subscription options on the mailing-list administrative interface.

Bug reporting

Bugs in Modules can be reported directly to the mailing list (see above for details) or to the bug tracker of the project. You can help us out by attempting to reproduce the bug in the latest released version of Modules.