A new script which creates Python 3.3 venvs with Distribute and pipinstalled in them

Discussion in 'Python' started by Vinay Sajip, Jan 30, 2013.

  1. Vinay Sajip

    Vinay Sajip Guest

    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 toalso 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 installedfor 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 area superset of the pyvenv script.

    Regards,

    Vinay Sajip
     
    Vinay Sajip, Jan 30, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    25
    Views:
    3,200
    Jonathan Hartley
    Jan 1, 2010
  2. Jazzis
    Replies:
    4
    Views:
    191
    Jazzis
    Sep 26, 2003
  3. Ian Kelly
    Replies:
    0
    Views:
    136
    Ian Kelly
    Jan 30, 2013
  4. Vinay Sajip
    Replies:
    0
    Views:
    138
    Vinay Sajip
    Jan 30, 2013
  5. Philippe Ombredanne
    Replies:
    0
    Views:
    143
    Philippe Ombredanne
    Jan 31, 2013
Loading...

Share This Page