Skip to main content

Persistent Conda Environments on CIROH 2i2c Server

To ensure your Conda environments persist across server restarts on the CIROH 2i2c server, create them in your home directory. Follow these steps:

1. Create a directory for Conda environments:

You can set up a directory within your home folder to store all your Conda environments. This prevents them from being removed when the server is restarted. For example:

mkdir -p ~/conda_envs

2. Create a new environment in that directory:

Use the --prefix option with conda create to specify the location where you want to create your environment. For example, to create an environment called my_env in ~/conda_envs:

conda create --prefix ~/conda_envs/my_env python=3.9

3. Activate the environment:

You can activate the environment as usual, using the path to where you created it:

conda activate ~/conda_envs/my_env

4. Automatically activate the environment on restart:

If you want this environment to be activated every time you log in or the server restarts, you can add the following to your .bashrc or .bash_profile file:

conda activate ~/conda_envs/my_env

By creating your environments in your home folder (e.g., ~/conda_envs/), they will persist across server restarts, ensuring that you don't have to recreate them every time.