June 18 is a university holiday (Juneteenth). July 2 & 5 are university holidays (Independence Day)
Next monthly maintenance July 12th 7am-11am - [Details]
Annual MGHPCC Power Shutdown Aug 9-12 [Details and Schedule]
STATUS PAGE Some systems are experiencing issues.

Search Docs by Keyword


Python on the FASRC cluster

We like the Anaconda python distribution from Continuum Analytics. It includes hundreds of the most popular packages for large-scale data processing, predictive analytics, and scientific computing (numpy, scipy, ipython, pandas, scikit-learn, mpi4py, etc.; see below for the full list). It generally does a great job of including the latest versions of all the packages while maintaining compatibility between them all.
You can use Python and Anaconda on the cluster by running:
For Python 2.x load
module load Anaconda/5.0.1-fasrc02
For Python 3.x load
module load Anaconda3/2019.10

Customizing the environment

Anaconda has a concept of environments; these are used to manage alternative package sets and versions. For example, if you want newer versions of some packages in the default environment, you can make a new environment with your customizations.
Load the base environment based on the version of python. To see the available versions, visit our Portal Module Lookup
Create a new environment:
conda create -n <name> <packages>

After loading the Anaconda module, you can use the following command to list the existing environments.

conda env list

Conda documentation has more details on different options. Use the following command to run the environment.
$ source activate <name>

If you want to use this environment all the time, add the above line to your ~/.bashrc (or other appropriate shell config file) after the line that loads the module.
At this point you can upgrade or install a package named PACKAGE with the following command (it’s the same whether installing or upgrading):
$ conda install PACKAGE

The commands conda list and conda show, which list installed and available packages, respectively. See the conda documentation for all the details. If the package is not available from conda, you can install it into your environment using pip:
$ pip install PACKAGE

Note: Anaconda generally has the lastest versions of all packages that are compatible. When you install an extra package, it’ll often update core packages like numpy and scipy; other packages may then downgrade them back. This is why we recommend sticking to the default environment if possible.
If you have problems updating a package that is already installed in the Anaconda environment, you might need to remove the package first:
$ conda remove PACKAGE
$ conda install PACKAGE

This will often bypass update errors, especially with certain versions of matplotlib.
To stop using the custom environment, run:
$ source deactivate

To remove old environments, you can run.

conda env remove -n <name>

The Conda Cheatsheet has other helpful commands.  conda-cheatsheet
[Conda Cheatsheet]

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Need help?
© The President and Fellows of Harvard College
Except where otherwise noted, this content is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license.