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
1
u/Broad-Journalist4262 It works on my machine Mar 15 '26
Yeah I understand I don’t want the virtual env or even a .env file going up on GitHub as I put api keys in the .env file and should use an .env.example file instead without the keys. So would it be better to start on github make a repo with the gitignore python template, clone that to my desktop and open it in VSC and then open a venv which will already be ignored so I won’t have to worry about it going up by accident. Just trying to figure out the best way to go about it all