If you do not want to change your home directory permissions you will need to use the shared directory in home for environments.
Please refer to these instructions for how to do this: Creating shareable environments with conda outside of /home/.
You still should do steps 1, 3, 4, and 5 even if you're creating a shared environment outside of your /home/
- Run the following command to switch your conda from a personal install to the global install of conda maintained by the HPC staff:
/opt/conda/bin/conda init bash
Note: this will change how conda functions if you have a local installation. Any environment created before this change will need to be activated using the full path (i.e. conda activate /home/<username>/*conda/envs/my_env). Any environment created after this change by default will be located under /home/<username>/.conda/envs. Named environments will only work for environments located in the ~/.conda/envs folder.
2. Create the environment for your course (we recommend you to use the following naming convention – BMIG_course#_initials):
conda create -n BMIG_XXXX_YY
Note: For your students to use your environment you must install the appropriate kernel for the languages used in the environment. The following commands should be run while the target environment is active.
To install the python kernel run: conda install -c anaconda ipykernel
To install the R kernel run: conda install -c r r-irkernel
3. Have your students check where they are running conda from by using the following command:
which conda
If the return is something other than /opt/conda/bin/conda the student will need to run /opt/conda/bin/conda init bash
4. If your students have not created an environment using the /opt/conda they need to create an empty environment to auto generate the ~/.conda directory
conda create -n test_env
5. Have your students run the following command where you substitute the full filepath to your env folder:
echo “/home/SE/BMIG_XXX_YY” >> /home/${USER}/.conda/environments.txt
You can do this with the command: chmod a+r with the location of your env folder after the '+r '.
You can do this with the following commands within the environment you want to share:
To install the python kernel run: conda install -c anaconda ipykernel
To install the R kernel run: conda install -c r r-irkernel