Python Environment Setup Instructions


Setup Instructions

Regardless of whether you use Windows, Mac, or Linux, we recommend using the free 'mamba' environment manager, which works on all major platforms

Another alternative is the conda environment manager:

We find mamba is much faster (by design, mamba intends to be conda but faster).

We will offer support in week one at office hours for installing or maintaining this environment on your laptop. It is ultimately your responsibility to acquire and maintain the packages and environments you need.

We have verified that these instructions successfully install the required environment on recent versions of all major operating systems.

One Time Setup: Install "micromamba"

Note: The instructions below are for Unix. Please adapt accordingly if you are on a non-Unix environment.

Expected time for this step: 15 minutes

  1. Install micromamba, a bare essentials version of mamba.

https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html

Tip for Unix users: After install, be sure to close your current terminal tab and open a fresh one, so that relevant paths get updated.

Tip for Windows users: It is recommended that you use Windows Subsystem for Linux (WSL) and then follow unix instructions for installing Mamba. If you install natively into windows and have an issue with Powershell initialization after installing micromamba, run the command micromamba shell before activating the environment.

One Time Setup: Install all necessary Python packages

Expected time for this step: 5 minutes

Expected disk space: About 1 GB (sorry! modern Python is quite bloated)

  1. Download the environment YAML file cs135_26s_env.yml

  2. At Unix terminal, ask your package manager to create a new environment and install relevant packages

#!bash
$ micromamba env create -f cs135_26s_env.yml  

If instead of micromamba you wish use mamba or conda, just replace the lead command micromamba with the relevant command.

Everyday use of the environment

Each time you open a terminal, activate* the environment

1
2
$ micromamba activate cs135_26s_env
$ # ... then call python or jupyter

After you've completed all work, you can deactivate

1
$ micromamba deactivate