virtualenv is a tool to create isolated Python environment
- Install it via apt-get:
$ sudo apt-get install python3-venv- traverse to the project folder
- create a virtual environment in current directory
$ virtualenv venv- this creates a copy of Python in whichever directory you ran the command in, placing it in a folder named
venv. - to begin using the virtual environment, it needs to be activated
$ source venv/bin/activate- install any new modules without affecting system default Python or other virtual environments using pip/pip3
- generate
requirements.txt
$ pip3 freeze > requirements.txt- if you are done working in the virtual environment , you can deactivate it
$ deactivate- to delete a virtual environment, just delete its folder
venv