We can use python virtual Environment to create many isolated project on our machine.
In Ubuntu 16.04, we first need to install python3-pip
$ sudo apt-get install -y python3-pip
Once it is installed we can use
pyvenv command to create an isolated project.
$ pyvenv testEnv oren@oren-computer:~/workspace/pythonEnvs $ cd testEnv/ /home/oren/workspace/pythonEnvs/testEnv oren@oren-computer:~/workspace/pythonEnvs/testEnv $ ls bin include lib lib64 pyvenv.cfg share
As we can see the pyvenv create a new folder and insert into this folder some basic files and folders.
To activate our project environment we need to run:
After running this command python will also run python3.
We will also see the name of the project in the terminal prompt.
Once we finish working and want to deactivate we can just run: