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


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

Re: How do I update a virtualenv?

Started byBen Finney <ben+python@benfinney.id.au>
First post2013-10-29 11:42 +1100
Last post2013-10-29 11:42 +1100
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? Ben Finney <ben+python@benfinney.id.au> - 2013-10-29 11:42 +1100

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

FromBen Finney <ben+python@benfinney.id.au>
Date2013-10-29 11:42 +1100
SubjectRe: How do I update a virtualenv?
Message-ID<mailman.1733.1383007380.18130.python-list@python.org>
Skip Montanaro <skip@pobox.com> writes:

> Hmmm... And my git repo?

You are keeping your virtualenv separate from your working tree, right?
I put mine in ‘/var/local/devel/$USER/virtualenvs/foobar/’ where
“foobar” is the specific virtualenv name.

This allows an arbitrary number of virtualenvs separate for each user
(‘/var/local/devel/$USER/’ is owned by each $USER), but all under one
directory tree where they can be treated specially for backup, cleanup,
permissions, or whatever.

> I imagine I will eventually figure this out, but updating an existing
> virtualenv in place to adapt to a new version of Python (say, a new
> micro) or some of its libraries (contents of requirements.txt) seems
> like it would be a very nice thing to have.

Yes, you simply ‘pip install -r ./requirements.txt’ again. It does a
simplistic “is the package already installed at this version in the
currently-active virtualenv? If not, install it in that virtualenv”.

The environment variables that determine where the virtualenv lives are
managed by ‘/var/local/devel/$USER/virtualenvs/foobar/bin/activate’. You
don't have the packages cluttering up your working tree.

-- 
 \       “I don't know anything about music. In my line you don't have |
  `\                             to.” —Elvis Aaron Presley (1935–1977) |
_o__)                                                                  |
Ben Finney

[toc] | [standalone]


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


csiph-web