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


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

Re: A new script which creates Python 3.3 venvs with Distribute and pip installed in them

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2013-01-30 13:42 -0700
Last post2013-01-30 13:42 -0700
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: A new script which creates Python 3.3 venvs with Distribute and pip installed in them Ian Kelly <ian.g.kelly@gmail.com> - 2013-01-30 13:42 -0700

#37962 — Re: A new script which creates Python 3.3 venvs with Distribute and pip installed in them

FromIan Kelly <ian.g.kelly@gmail.com>
Date2013-01-30 13:42 -0700
SubjectRe: A new script which creates Python 3.3 venvs with Distribute and pip installed in them
Message-ID<mailman.1230.1359578564.2939.python-list@python.org>
On Wed, Jan 30, 2013 at 1:09 PM, Vinay Sajip <vinay_sajip@yahoo.co.uk> wrote:
> Python 3.3 includes a script, pyvenv, which is used to create virtual environments. However, Distribute and pip are not installed in such environments - because, though they are popular, they are third-party packages - not part of Python.
>
> The Python 3.3 venv machinery allows customisation of virtual environments fairly readily. To demonstrate how to do this, and to provide at the same time a script which might be useful to people, I've created a script, pyvenvex.py, at
>
> https://gist.github.com/4673395
>
> which extends the pyvenv script to not only create virtual environments, but to also install Distribute and pip into them. The script needs Python 3.3, and one way to use it is:
>
> 1. Download the script to a directory in your path, and (on Posix platforms) make it executable.
> 2. Add a shebang line at the top of your script, pointing to your Python 3.3 interpreter (Posix, and also Windows if you have the PEP 397 launcher which is part of Python 3.3 on Windows).
> 3. Run the pyvenvex script to create your virtual environments, in place of pyvenv, when you want Distribute and pip to be installed for you (this is how virtualenv sets up environments it creates). You can run the script with -h to see the command line options available, which are a superset of the pyvenv script.

I have a shell script for this:

#!/bin/sh
python3 -m venv $1
cd $1
. bin/activate
wget http://python-distribute.org/distribute_setup.py
python distribute_setup.py
bin/easy_install pip

[toc] | [standalone]


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


csiph-web