Tuesday, April 13, 2021

Creating & Using Virtual Environments

Creating & Using Virtual Environments

1) To create a virtual environment, open an Anaconda prompt.

2) Type "conda create --name Your_vir_env libraries_to_install", e.g., 

conda create --name py_vir jupyter nb_conda ipykernel keras

3) To load the virtual environment, type: "conda activate Your_vir_env", e.g.,

conda activate py_vir

4) The left column of the prompt should change from "base" to "Your_vir_env".

5) To install other libraries later, load the virtual environment using step 3 and type "conda install libraries_to_install", e.g., to install pandas, type:

"conda install pandas"

6) To launch jupyter notebook, load in the virtual environment using step 3 & type “jupyter notebook”. It will open a new tab in the browser.

No comments:

Post a Comment