>>> Virtual Environments
A virtual
environment helps to test our code or run applications with other versions of
python. It is quite easy to create a virtual environment. Let me make this clearer to you...
For
instance, currently, your python code is in 1 version and if the new python
update is released i.e. 2 and you want to test your code with the new version
without losing the old then you should create a virtual environment and run the
code.
1. Open the CMD or Anaconda Prompt.
2. You can create a virtual environment
with a command called “conda create –name jaswanth24 biopython”
Here in the
above sentence: jaswanth24 is the name of the new virtual environment. Biopython
is the basic version of python. Some of the commands are ...
ü conda create --name jas24 numpy
ü conda create –name jasreddy24
anaconda
ü conda create –name jaswanthreddy24
python 2.5
Here the
first command means, it only creates numpy and it doesn’t create pandas or any
other libraries.
The second
command means it creates the whole anaconda environment with all libraries.
The third
command helps to install python with specific version 2.5
3. After it will ask Y/N (yes or no)
type yes and then press enter ...
4. Later it will install successfully
but, you need to activate it whenever required with the help of the following
command “activate jaswanth24” (which means activate your environment
name.)
5. You can also deactivate it with a command called “deactivate”.