In order to separte the python enviroments in which multiple machining learning or deep learning tools are deployed, it is necessary to install multiple python virtual enviroments in a computer. This blog mainly introduces some tips about the effective management of python virtual environments by using the conda.

Knowing Current Python Enviroment

Type the command on shell to look for the location of python:

1
$ which python

Sometimes, the python install tool pip is not in the same environment with python, we could also type the command on shell to look for the location of pip:

1
$ which pip

Switch Python Enviroment

Once the location of current python environment, we could switch python enviroment as we want. For example, in addition to the python in the system enviroment, which is current python enviroment according to my looking, there are two another virtual enviroments (i.e., datascience and deeplearning) in my computer. Then, we could type the following commond to switch python environments:

1
$ conda activate datascience // switch to datascience virtual enviroment

Similarly, we could type which python and which pip to check whether it is successful to switch the python enviroments.
If we want switch the virtual environment to the system python environment, we could directly type:

1
$ conda deactivate