Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitignore for a python venv based in the root of a git project

Tags:

git

python

I'm setting up a python project in git and the I want to run the project in a venv. I'm running python3 -m venv . in the root of the git repo.

This creates multiple directories and a file:

  • bin
  • include
  • lib
  • lib64
  • share
  • pyenv.cfg

Which of these files and folders are import to my colleagues to set up the environment in the same way I did? In the root of the project I've also included this script to set up:

python3 -m venv .
source bin/activate
pip3 install -r requirements.txt
like image 823
jokarl Avatar asked Oct 16 '25 16:10

jokarl


1 Answers

You should ignore the entire venv folder.

To make that easier, you probabaly want to do python3 -m venv .venv instead, and add .venv to your .gitignore file.

like image 175
Tomas Aschan Avatar answered Oct 18 '25 10:10

Tomas Aschan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!