A virtual environment is an isolated folder that contains its own Python interpreter and its own packages, specific to a project. python -m venv creates it and pip installs the dependencies in it, listed in a requirements.txt file. This avoids version conflicts between projects.
Example
python -m venv .venv
pip install requests