When using Python on Asha, we recommend using the default install and Python Virtual Environments. This allows you to install your own packages and reduces library conflicts. 


Set up Anaconda (Only need to do this once)

  1. Log into the Asha
  2. Load the anaconda module
    1. module load apps/anaconda3
  3. Initialize anaconda
    1. conda init
  4. Change the environment location to your /scratch directory
    1. conda config --add envs_dirs /scratch/<your_username_here>/anaconda_environments


Create your first environment

  1. Use conda to create a named virtual environment using your preferred version of Python.
    1. conda create --name environment_name python=python_version
      • e.g. conda create --name test_environment python=3.8 


Using your virtual environments.

  1. Activate your preferred environment
    1. conda activate environment_name
      • e.g. conda activate test_environment
  2. Install Python packages, run a python program, or start the interpreter
    1. Install packages
      1. conda install package_name
        or
      2. pip install package_name
    2. Run a Python program.
      1. python my_program.py
    3. Start the intrepreter.
      1. python
  3. When you submit your job, your environment will be read and sent with the job to be run. 


When done using the environment, log out or deactivate the environment with the command "conda deactivate"