
Therefore, there must already have an active python environment installed on your system. It uses links to global environment files instead in order to save disk space end speed up your virtualenv. Virtualenv does not create every file needed to get a whole new python environment. Packages installed in the virtual environment will not affect the global Python installation. To deactivate your python virtualenv, just type “deactivate” in the command line. The installations will have no effect on the python installation in the /etc/bin folder of the system. That is how you can see that you’re in your new environment.Īfter activating the virtual environment, any new installations will be installed to this environment only. Notice how the prompt of your shell changed to show the active environment. Finally, activate your environment using the following command.Īfter execution of the above command, python virtualenv will be activated on your machine.For this, cd into your project directory’s bin folder. To begin working on your project, you have to activate the virtual environment after creating it.You can add –no-site-packages in the command if you want to isolate your environment from the main site-packages directory. Virtualenv ~/virtualenvironment/my_new_app To create a folder for your new app that includes a clean copy of Python, you can use the following command. After creating the folder for the virtual environment, we will create a folder for our python execution using virtualenv.

For instance, to create a folder named virtualenvironment in the home directory, you can use the following command. For this, you can use the mkdir command and give the full pathname of the directory to be created.

First, create a directory for your new shiny isolated environment.Once you have virtualenv installed on your system, just fire up a shell and create your own environment using the following steps. If you are using python3, you can use pip3 instead of pip in the above command., Setup and Use Virtualenv in Linux

If can also use python’s PIP to install virtualenv using the following command. If you want to install python virtualenv using the easy_install package installer, you can use the following command. To install virtualenv using the apt package management system, you can use the following command. There are a number of ways to install virtualenv on your system. If virtualenv is not installed on your system, you can install it in Linux using the commands discusses in the following section Install Virtualenv in Linux Ubuntu virtualenv -versionĪfter execution of the above command, If you see a version number (in my case 1.6.1), it’s already installed on your system. To check if it’s already installed run the following command in your terminal. There is a chance that python virtualenv is already installed on your system. Install virtualenv and Verify the Installation
