[Distutils] Require a specific Python version

M.-A. Lemburg mal@lemburg.com
Mon Apr 15 11:35:05 2002


Peter Bienstman wrote:
> 
> > > Is there any way to specify in setup.py that a particular
> > > distribution requires e.g. Python 2.2, such that an error is issued if
> > > users try to install it on an earlier Python version?
> >
> > import sys
> > if sys.version < '2.2':
> >    print 'Wrong Python Version !!!'
> >    sys.exit(1)
> 
> Yes, but I assume this won't show up when e.g. executing a binary
> installer for Windows?

That's correct. The bdist_wininst command has an option
for this though:

                   ('target-version=', 'v',
                     "require a specific python version" +
                     " on the target system"),

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Software:                   http://www.egenix.com/files/python/