Martin Martin - 1 year ago 87
Python Question

Virtualenv and source version control

I recently started a Django project and I quickly realized that virtualenv will be really useful for many reasons. I set up the virtualenv and my project, but now I wonder what file I should add to my source control (in my case, Mercurial). Should I add all the files under the venv folder? How do I make sure a colleague can clone and get started to work immediately withou having to setup the env again?

Answer Source

You generate a "requirements" file (usually requirements.txt) that you commit with your project:

pip freeze > requirements.txt

Then, each developer will set up their own virtualenv and run:

pip install -r requirements.txt
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download