How to create python virtual environment
Steps to install Python Virtual Environment
-
Install Python
-
Install Python Pip
-
Install Virtual enviroment
Command to install Python
sudo apt install python
Command to install Python-Pip
sudo apt-get install python-pip
Command to install Virtual Env
pip install virtual env
sudo apt install virtualenv
Now you have successfully installed the Python Virtual Environment. The next is how to create a virtual env.
Make a directory where you want to setup this virtual env. And follow the commands.
This is a example. I have created a directory named environments and inside that directory I have created a virtual-env named project1.
mkdir environments;
cd environments;
virtualenv project1;
This is the command to activate the virtual-env
source project1/bin/activate
Now you are successfully activated the virtual-env. You can see your project name in you terminal.
To deactivate and come out of the virtual-env using this command
deactivate
If you need to access this virtual-env you can go back to the last directory and activate it using the last command we used to activate.
Previous Feb 18, 2019
« PHP Object Injection
« PHP Object Injection
Aug 19, 2019 Next
How to install InvoiceNinja »
How to install InvoiceNinja »