Installation help
Conda environment
Creating an environment from an environment.yml file
Tutorial comes from this website
Use the terminal or an Anaconda Prompt for the following steps:
Create the environment from the environment.yml file:
conda env create -f environment.yml
The first line of the yml file sets the new environment’s name.Activate the new environment:
conda activate myenv
Verify that the new environment was installed correctly:
conda env list
You can also useconda info --envs
.
Sharing an environment
Tutorial comes from this website
You may want to share your environment with someone else—for example, so they can re-create a test that you have done. To allow them to quickly reproduce your environment, with all of its packages and versions, give them a copy of your environment.yml file.
Activate the environment to export:
conda activate myenv
Replace myenv with the name of the environmentExport your active environment to a new file:
conda env export > environment.yml
Email or copy the exported
environment.yml
file to the other person.
Jupyter Notebook
Kernels
Create kernel from conda environment
Tutorial comes from this website
Step 1: Create a Conda environment.
conda create --name firstEnv
Step 2: Activate the environment using the command as shown in the console. After you activate it, you can install any package you need in this environment.
conda install library
Step 3: Create Jupyter Kernel.
Now comes the step to set this conda environment on your jupyter notebook, to do so please install ipykernel.
conda install -c anaconda ipykernel
After installing this, just type:
python -m ipykernel install --user --name=firstEnv
Step 4: Just check your Jupyter Notebook, to see the shining firstEnv.
List kernels
jupyter kernelspec list
Remove kernel
jupyter kernelspec remove <kernel-name>