[Distutils] pythonv: let's also make sure the standard Python install includes an "isolated" python

Carl Meyer carl at oddbird.net
Thu Mar 17 17:44:49 CET 2011

On 03/17/2011 10:59 AM, Barry Warsaw wrote:
> On Mar 17, 2011, at 08:07 AM, Jim Fulton wrote:
>> Whatever mechanism we end up with, I suggest that a standard python
>> install include an isolated configuration. This is a common use case
>> and should be available without having to create a virtualenv (or
>> whatever) for each project or working directory.
> Could you elaborate on what this means?  I don't quite understand what you
> mean by "include an isolated configuration".

I'm also not entirely clear what this means, but I think perhaps "python
-S" already covers it? That will start up a python interpreter without
importing site.py, so it will have no site-packages at all; nothing but
the stdlib. Of course, then you'd have to take care of fixing up
sys.path yourself to include your project and its dependencies: this may
be reasonable for buildout.

> I do think that Python should include a script to create the small amount of
> set up needed to trigger a (built-in) virtual environment.  E.g. create the
> bin and lib/... directories, populate bin, and drop a minimal pythonv.conf
> file.

Definitely. It looks like this'll end up being the bulk of the added
code; I'm planning to do it (borrowing liberally from virtualenv.py) as
soon as I'm confident of the basic approach.

Any opinions on the commandline UI for this? I was thinking of just
adding a "pythonv.py" to the stdlib that you could execute with "python
-m pythonv path/to/new/env" (and would also export appropriate API to
create environments programmatically).


More information about the Distutils-SIG mailing list