custom environments
Creating the environment
1. Open a new Terminal
2. in case the environment should be avaliableavailable permanently
conda config --add envs_dirs /home/jovyan/.conda_envs
open3. newcreate Terminalenvironment with conda
conda create --name myenv
4. initialize bash shell
conda init bash
5. restart shell
source ~/.bashrc
then:6. activate environment:
conda activate myenv
Activating an environment
these steps need to be executed to activate an environment
1. initialize bash shell
conda init bash
2. restart shell
source ~/.bashrc
3. activate environment:
conda activate myenv
Exporting environment to custom Kernel image
First, activate your virtual environment (shell) and run this:
pip install --user ipykernel
We need to manually add the kernel if we want to have the virtual environment in the Jupyter Notebook. That is why we need to add it by running this code.
python -m ipykernel install --user --name=myenv
when creating a new notebook, you can choose your new kernel image
If you have finished with the virtual environment and did not need it anymore, you could remove it using this code.
jupyter kernelspec uninstall myenv