Add the environment directory to .gitignore.
Section: Project bootstrap
Ignore the local venv in Git
gitignore
gitignore
.venv/
venv/
__pycache__/
*.pyc
Explanation
You normally commit dependency files, not the environment directory itself.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Project bootstrap
Create project and venv
Create a project folder and initialize a virtual environment.
Install common local tooling
Install formatter, linter, and test tooling in the venv.
Install project editable from pyproject
Install the current project into the venv in editable mode.