V. Virtual Environments - JulTob/Python GitHub Wiki

Virtual Environment

VE allowsyou to manage separate package installation that you need for a particular project, isolation the packages installed in other environment.

Installation

pip install virtualenv

Create a VE

To create a VE , go to your project's directory and run virtualenv.
For example, if the name of your project folder is Test_Environment do:

$ cd Test_Environment
$ virtualenv test

This will create a folder in the current working directory that includes Python executable files of your base Python interpreter installed earlier, and a copy of the pip library, which you can use to install other packages.

To activate the environment run:

$ source test/bin/activate

The name of the current virtual environment will now appear on the left of the prompt. Package installation will be placed in the isolated 'test' folder.

# Virtual environment louncher for testings
# To create a new virtual environment, open a terminal and run the following command:
# python3 -m venv weatherterm
# . weatherterm/bin/activate

virtualenv -p python3 venv
. venv/bin/activate

pip3 install numpy