Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'interpreter': 0.04; 'subject:Python': 0.05; 'python3': 0.05; 'python': 0.09; 'path,': 0.09; 'pep': 0.09; 'script,': 0.09; 'subject:script': 0.09; 'url:github': 0.09; '1:09': 0.16; 'executable.': 0.16; 'posix': 0.16; 'subject: \n ': 0.16; 'subject:3.3': 0.16; 'subject:which': 0.16; 'url:py': 0.16; 'windows).': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'script.': 0.17; 'jan': 0.18; 'shell': 0.18; 'windows': 0.19; 'fairly': 0.21; 'people,': 0.21; '(on': 0.22; 'environments': 0.22; 'extends': 0.22; 'demonstrate': 0.23; 'sets': 0.23; 'third-party': 0.23; 'this:': 0.23; 'installed': 0.23; "i've": 0.23; '(this': 0.24; 'command': 0.24; 'script': 0.24; 'allows': 0.25; 'header:In-Reply- To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'options': 0.27; 'run': 0.28; 'install': 0.29; 'distribute': 0.30; 'to:addr:python- list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'add': 0.36; 'created': 0.36; 'but': 0.36; 'url:org': 0.36; 'useful': 0.36; 'subject:with': 0.36; 'virtual': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'your': 0.60; '30,': 0.62; 'provide': 0.62; '2013': 0.84; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=TySXCi5svG7hGdGFYE0HOGhmFuDWKOE4Oqwg5SDXVF4=; b=uAArIAl082uqTOgsJ6q8EjbzM0CEHyKtRpaGsSn5pNSpG6ui6lf90qpeZjZSjrEnBM WDUeVto39kz9Z7vwtMPVbe62UVJMGK4uqniTi76YAkqGkFPDU6uApAw/gCI93tZup3zt gT9ujWLtor07YTNmrPc0iaEGqtGwKJbdDN1wOBMG7x6sG+R0ErA302+1gHSSiRO4vo6p A/hUX3Rn2pLVhNaTcBHhoxzrNaKrfOq8wpaxxUanajCayER55+VeKJFZfMybcuDAmdDD oLsEvIwsv47aWg2R5IVhfCI+gU2FkjqgShS4/Fa2J+N5MRXF1yX/TX5A2mLaXVeP/t2/ 8SKA== X-Received: by 10.68.196.133 with SMTP id im5mr15991920pbc.16.1359578560485; Wed, 30 Jan 2013 12:42:40 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1359576541.17079.YahooMailNeo@web171404.mail.ir2.yahoo.com> References: <1359576541.17079.YahooMailNeo@web171404.mail.ir2.yahoo.com> From: Ian Kelly Date: Wed, 30 Jan 2013 13:42:09 -0700 Subject: Re: A new script which creates Python 3.3 venvs with Distribute and pip installed in them To: Python Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1359578564 news.xs4all.nl 6903 [2001:888:2000:d::a6]:45478 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37962 On Wed, Jan 30, 2013 at 1:09 PM, Vinay Sajip wrot= e: > Python 3.3 includes a script, pyvenv, which is used to create virtual env= ironments. However, Distribute and pip are not installed in such environmen= ts - because, though they are popular, they are third-party packages - not = part of Python. > > The Python 3.3 venv machinery allows customisation of virtual environment= s 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, pyve= nvex.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 platfor= ms) 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 w= hich 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 i= s how virtualenv sets up environments it creates). You can run the script w= ith -h to see the command line options available, which are a superset of t= he 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