-
Notifications
You must be signed in to change notification settings - Fork 0
Virtual environments
Bazyli Polednia edited this page Mar 9, 2021
·
1 revision
To isolate your global Python environment with the one used for project, create a virtual environment. It is a separate environment, initialized without any global packages - this way you can be sure that the code works exactly like it's supposed to without any global modules interfering.
To create and activate you virtual environment, run following steps:
- Make sure you have python3.8 installed:
python3→ should open Python 3.8 console - Create virtual environment in your project directory:
python3 -m venv venv - Activate your new environment:
. venv/bin/activate - Install required packages:
- basic packages:
pip install -r requirements.txt - packages for developing code:
pip install -r requirements-dev.txt - packages for running tests:
pip install -r requirements-test.txt
- basic packages:
- When you are done working with your virtual environment, you can disable it:
deactivate - To enable it back, simply rerun:
. venv/bin/activate
Gradient PG - visit us!