Virtualenv和源版本控制 [英] Virtualenv and source version control
本文介绍了Virtualenv和源版本控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
你会生成一个同事可以克隆并立即开始工作您的项目提交的需求文件(通常为 requirements.txt
):
code>点击冻结>每个开发人员将设置自己的virtualenv并运行: $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
pip install -r requirements.txt
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?
解决方案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
这篇关于Virtualenv和源版本控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文