Python Evironment
Shekhar Pandey
Tech Lead | Digital Transformation, Robotics Process Automation, Machine Learning, Artificial Intelligence, AIOps, DevOps, Cloud Computing
A python environment allows to install libraries and dependencies of different versions in different environments.
It is a very clean way to segregate libraries of different versions and be able to use these based on project requirements.
I have already installed anaconda for Python and using windows os.
How to check already available conda environments ?
At Anaconda prompt , execute following command
conda env list
How to create a new environment ?
conda create -n test_env_3 python=3.6
test_env_3 is name of environment and we are specifying to use python 3.6
How to activate an environment ?
conda activate test_env_3
How to list all packages available in env?
conda list
Add Conda environment as Jupyter Kernel
# First activate env. if not already done at anaconda prompt conda activate test_env_3 # Second,install ipykernel conda install ipykernel # Third, for the env. create kernel python -m ipykernel install --user --name test_env_3 --display-name "Python_testenv_3_6"
Launch jupyter notebook, you would see new kernel as Python_testenv_3_6
jupyter notebook
Also install another package to manage conda environments from jupyter more efficiently
conda install nb_conda