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


Groups > comp.lang.python > #57861

Re: How do I update a virtualenv?

Return-Path <nedbat@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'git': 0.09; 'reinstall': 0.09; 'subject:update': 0.09; 'subject:virtualenv': 0.09; 'to:addr:pobox.com': 0.09; 'to:addr:skip': 0.09; 'subject:How': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; 'run:': 0.16; '(you': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'packages.': 0.19; 'seems': 0.21; 'cc:addr:python.org': 0.22; 'install': 0.23; 'installation': 0.23; 'header:User-Agent:1': 0.23; "aren't": 0.24; 'skip': 0.24; 'versions': 0.24; 'file.': 0.24; 'cc:2**0': 0.24; 'updating': 0.26; 'header:In-Reply-To:1': 0.27; 'installed': 0.27; 'moved': 0.30; 'usually': 0.31; 'another.': 0.31; 'libraries': 0.31; 'figure': 0.32; 'maybe': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'activate': 0.36; 'subject:?': 0.36; 'list': 0.37; 'server': 0.38; 'pm,': 0.38; 'even': 0.60; 'easy': 0.60; 'eventually': 0.60; 'new': 0.61; 'have.': 0.93; 'imagine': 0.93; 'technique': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=TARNahCji8Npd42upJ6SUQzHODZShRMgdFoHmci2kII=; b=LYwuBhR2U7XGZxdNXzcs8O4sC/qbEZo1QDc/bbmiJ4OGgNsi6JW4sEOz8q2EXjlDzZ LvwMB1EqZWUTaeIktscQDWgZgYGi/dTQ1IupYZ968FkOXh32vxmciR3tmCDJCTZtHivL LL9AcHtOaPsU27N8ii8AgeGoHBembftuHzyBir9m9aVR6BOZUCe43oBoPC4I0+aRpCdu gL7opCoCgXQ7w0vhH5urSC3oTivPAINg9XLmcukyEpQd94bgtb0MjKnWoOqf5lpGERSH d6nzEU4Z0o0xazipPXmDCRYrWEjGAOzJZt558co+c8ndFW4PZMI+ch0pCAVQfVSLYQTg Zw+w==
X-Received by 10.236.73.1 with SMTP id u1mr100875yhd.91.1383005616610; Mon, 28 Oct 2013 17:13:36 -0700 (PDT)
Sender Ned Batchelder <nedbat@gmail.com>
Date Mon, 28 Oct 2013 20:13:35 -0400
From Ned Batchelder <ned@nedbatchelder.com>
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.0.1
MIME-Version 1.0
To Skip Montanaro <skip@pobox.com>
Subject Re: How do I update a virtualenv?
References <CANc-5Uy367Mu-zN30Z8xKfE_Zf9q4G15E_oVtB+HOWPja6MNag@mail.gmail.com> <526EF04A.6070702@nedbatchelder.com> <CANc-5UxvR=woVE19a14rTAKX4qwzdPEVgoj0XxX169DU_uKMWw@mail.gmail.com>
In-Reply-To <CANc-5UxvR=woVE19a14rTAKX4qwzdPEVgoj0XxX169DU_uKMWw@mail.gmail.com>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
Cc Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1731.1383006012.18130.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1383006012 news.xs4all.nl 16003 [2001:888:2000:d::a6]:36330
X-Complaints-To abuse@xs4all.nl
Path csiph.com!usenet.pasdenom.info!gegeweb.org!feed.ac-versailles.fr!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Xref csiph.com comp.lang.python:57861

Show key headers only | View raw


On 10/28/13 7:53 PM, Skip Montanaro wrote:
>> 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.
> Hmmm... And my git repo?
Usually the virtualenv is outside the git repo (and vice-versa), but git 
repos are also easy to recreate from the git server if you need to.  
Maybe I don't understand what you mean?

> 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.

"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.

> Skip

--Ned.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: How do I update a virtualenv? Ned Batchelder <ned@nedbatchelder.com> - 2013-10-28 20:13 -0400
  Re: How do I update a virtualenv? Roy Smith <roy@panix.com> - 2013-10-28 20:48 -0400

csiph-web