Skip to content

Commit 3b3f326

Browse files
authored
Update README.md
Add a command to add kernels for all the conda environments
1 parent 6769a70 commit 3b3f326

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,11 @@ conda create --clone old_name --name new_name
153153

154154
This will eliminate the need to install repeated packages.
155155

156-
156+
#### Re-adding kernels
157+
The kernel list is located outside your home directory, so it can be reseted sometimes.If that happens, run this one-line command from your terminal to add **every conda environment** on your profile to the kernel list.
158+
```bash
159+
pip install -U ipykernel; ENVS=$(conda info --envs | grep '^\w' | cut -d' ' -f1); for env in $ENVS; do source activate $env; python -m ipykernel install --user --name $env; echo "$env"; conda deactivate; done
160+
```
157161

158162
#### Using pip
159163
pip defaults to installing Python packages to a system directory. To make sure that your packages persist they need to be installed in your home directory use the `--user` option to do this.

0 commit comments

Comments
 (0)