---
title: "Custom Environments"
canonical: "https://kb.uconn.edu/space/SH/27303804955/Custom%20Environments"
format: markdown
---
> Macro (toc)

### Utility Commands for Custom Kernels

After loading an environment

List your current kernels

```
jupyter kernelspec list
```

Remove a kernel

```
jupyter kernelspec uninstall {KERNEL_NAME}
```

### Custom Conda Environments in Jupyter

For information on how to create custom conda environments, please visit our guide:

[Miniconda Environment Set Up - Storrs HPC - UConn Knowledge Base](https://kb.uconn.edu/space/SH/26079723879/Miniconda+Environment+Set+Up)

 Begin by activating/creating your desired environment:

```
conda create -n myenv
```

> ℹ️ The python version can be specified as well if necessary:  
> ℹ️ `conda create -n myenv python=3.7.3`

```
conda activate myenv
```

Once you are in the environment, install `ipykernel` with the following command:

```
conda install ipykernel
```

Add the environment to your jupyter kernels:

```
python3 -m ipykernel install --user --name=myenv --display-name "myenv" --env PATH $PATH
```

Follow the instructions to launch [jupyter](https://kb.uconn.edu/space/SH/27304067102/Jupyter). You should now be able to select the environment we just added:

![image-20241112-192239.png](media://a09743fb-9465-4a6d-bd90-369a6ae3eee0)

> 📝 If Jupyter does not see your conda environment or has issues connecting to the kernel, remove the following directory:
> 📝 
> 📝 ```
> 📝 rm -rvf /home/netidhere/.local/share/jupyter/kernels/myenv
> 📝 ```
> 📝 
> 📝 Replace “netid” with your netid.
> 📝 
> 📝 Once the directory is removed, recreate the directory with the following command:
> 📝 
> 📝 ```
> 📝 python3 -m ipykernel install --user --name=myenv --display-name "myenv" --env PATH $PATH
> 📝 ```

### Custom Python Environments in Jupyter

 Load the desired version of python

```
module load python/3.10.5
```

Create a directory for your desired environment:

```
mkdir myenv
cd myenv
python -m venv .
```

```
. bin/activate
```

Once you are in the environment, install `ipykernel` with the following command:

```
pip install ipykernel
```

Add the environment to your jupyter kernels:

```
python3 -m ipykernel install --user --name=myenv --display-name "myenv" --env PATH $PATH
```

Follow the instructions to launch [jupyter](https://kb.uconn.edu/space/SH/27304067102/Jupyter). You should now be able to select the environment we just added:

![image-20241112-192239.png](media://a09743fb-9465-4a6d-bd90-369a6ae3eee0)