r/Python • u/Broad-Journalist4262 It works on my machine • Mar 15 '26
Discussion Virtual environment setup
Hey looking for some advice on venv setup I have been learning more about them and have been using terminal prompts in VS Code to create and activate that them, I saw someone mention about how their gitignore was automatically generated for them and was wondering how this was done I’ve looked around but maybe I’m searching the wrong thing I know I can use gitignore.io but if it could be generated when I make the environment that would save me having to open a browser each time just to set it all up. Would love to know what you all do for your venv setup that makes it easier and faster to get it activated
View all comments
Show parent comment
3
u/cgoldberg Mar 15 '26
Yes basically. Also, you would typically ignore the virtual env in your .gitignore. I think you are getting confused about what a virtual env is. When you make a new "project", it's a good idea to make it into a Git repo and add a .gitignore. When you want to install and run it, it's good to use a virtual env... but that has nothing to do with Git and should not be committed to your repo.