- To generate the file with the requirements.txt type at the prompt:
pip freeze > requirements.txt
To install all packages contained in the requirements.txt file, type at the prompt:
pip install -r requirements.txt
- Type at the prompt:
python3 -m venv venv
- Run the file 'activate' which is in the directory
venv/bin/activate (#if on Linux).
- In Windows, the command is a little different, being necessary to execute the file activate.bat, that way the command to activate the venv on windows it would be venv\Scripts\activate.bat
- Once activated, it will indicate that the venv is activated.
- To disable, type at the prompt:
deactivate
Source: 'https://huogerac.hashnode.dev/estrutura-e-organizacao-de-pastas-em-projetos-flask'