Getting started with Conda for setting up Jupyter Notebook
- for windows https://docs.conda.io/en/latest/miniconda.html or for linux https://conda.io/projects/conda/en/latest/user-guide/install/linux.html +
export PATH=~/miniconda3/bin:$PATH + conda init bash (if using vs code as terminal of vs code is not registered in conda)
2) Creating a virtual environment
2.1)
conda create --name myenv
or
conda create -n myenv
2.2)
conda create -n myenv python=3.6
or
conda create -n myenv python=3.6 scipy=0.15.0 astroid babel
2.3)
conda env create -f environment.yml
3) Checking whether virtual environment is created or not
conda env list
4) Activating virtual environment
4.1)
conda activate myenv
4.2)
conda list
5) Installing package(s) inside virtual environment you just created
5.1)
conda install numpy
or
conda install numpy==1.19.3
or
conda install numpy==1.19.3 pillow urllib3
5.2)
conda install pip
and then,
pip install tensorflow-cpu
5.3)
conda install jupyter notebook
then,
python -m ipykernel install --user --name=myenv
6)
jupyter notebook
7) Sharing the virtual environment (having installed packages) as a yml file
firstly select a particular destination
cd
then,
conda env export > environment.yml
8) Deleting the virtual environment
first deactivate and get out of current virtual environment
conda deactivate
then,
conda remove --name myenv --all
to recheck,
conda env list
9) Deleting kernels from Jupyter Notebook
jupyter kernelspec list
then which ever you want to delete
jupyter kernelspec remove <kernel_name>