How do I update a virtualenv?
Roy Smith
roy at panix.com
Mon Oct 28 20:48:15 EDT 2013
In article <mailman.1731.1383006012.18130.python-list at python.org>,
Ned Batchelder <ned at nedbatchelder.com> wrote:
> "pip install --upgrade" will upgrade your Python packages. "pip install
> -r requirements.txt" will install new packages or versions named in the
> requirements.txt file.
Yup, that's what we do. We've got a requirements.txt file that's
checked into our source repo. Part of our deployment process is to run
"pip install -r requirements.txt".
You want to start doing this from day one on any new project. One of
the problems we had was we started not even using virtualenv. When we
switched to do that, we needed to come up with a list of what should be
in it. We started with "pip freeze", and got a list of all the crap we
currently had installed. We then needed to start sorting through it to
figure out what we really needed and what was just excess baggage. It's
a lot cleaner if you start out doing it right at the beginning.
We build a fresh virtualenv on every code deployment. This makes sure
we know exactly what's in the virtualenv all the time. It's a little
extra work, but worth it.
We're looking at https://pypi.python.org/pypi/wheel to reduce deployment
time.
More information about the Python-list
mailing list