Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #57856 > unrolled thread

Re: How do I update a virtualenv?

Started byNed Batchelder <ned@nedbatchelder.com>
First post2013-10-28 19:16 -0400
Last post2013-10-28 19:16 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How do I update a virtualenv? Ned Batchelder <ned@nedbatchelder.com> - 2013-10-28 19:16 -0400

#57856 — Re: How do I update a virtualenv?

FromNed Batchelder <ned@nedbatchelder.com>
Date2013-10-28 19:16 -0400
SubjectRe: How do I update a virtualenv?
Message-ID<mailman.1726.1383002195.18130.python-list@python.org>
On 10/28/13 7:04 PM, Skip Montanaro wrote:
> I have a virtualenv I'm using for some Django development.  Today I
> switched from MacPorts to HomeBrew on my Mac. I'm thus getting a
> different version of gcc and its libs. How do I reinstall the
> virtualenv? I've looked around and found a few descriptions of what to
> do, but as I am little more than a monkey-see-monkey-do user of
> virtualenv, I don't understand what appears to be a fairly complex set
> of steps. Does virtualenv not have some sort of "upgrade" command that
> just does what's necessary?
>
> Thanks,
>
> Skip

Virtualenvs aren't built to be moved from one Python installation to 
another.  If you used pip to install your packages (you should), then 
you can activate the virtualenv, and run: $ pip freeze > requirements.txt

Then you can create a new virtualenv using the new Python executable, 
activate it, and:  $ pip install -r requirements.txt

This will reinstall all the packages you had installed previously. Even 
better is to maintain your own requirements.txt that has just the 
packages you need.  The "pip freeze" technique will also list packages 
installed as dependencies.

--Ned.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web