Python Virtual Environment

Overview

Python Virtual Environment helps to create isolated Python Environment. Different projects might require different version of python and packages that are not part of standard python library. Using virtual environment, solves this issue.

Creating Virtual Environment

python3 -m venv art-env

Activating Virtual Environment

source art-env/bin/activate

Basically what this command is doing is using the local, clean install of Python in your virtual environment to run your commands.

Installing Packages

python -m pip install requests

Get Back out of the Environment

deactivate

Saving your Modules

pip freeze > requirements.txt
pip install -r requirements.txt