I am starting to understand the advantages of virtualenv. Now, I have created virtualenv folder named venv
by doing virtualenv venv
.
Now my question is, Is it useful to push this folder to github or should I add it to .gitignore
?
Yes, delete the directory. it's where executables for the venv and modules and libraries and entire other stuff for venvs is kept.
Always use a Virtual Environment You are in control of which packages versions are installed and when they are upgraded. You can have as many venvs as you want.
venv suggests it's private. So would not recommend that at all. Some tools use . venv but in that case the intent is that the user will not interract with the venv directly, but rather through the tool (e.g. poetry).
These are almost completely interchangeable, the difference being that virtualenv supports older python versions and has a few more minor unique features, while venv is in the standard library.
You should add it to gitignore file.
Then, you should create requirements.txt
file and populate it with the packages you have installed. Then, on your production server, create the virtual environment and run pip install -r requirements.txt
.
Read this to learn more about the requirements file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With