views:

49

answers:

2

Hi,

I am trying to distribute my Python program. The program relies on version 2.6. I went through the distribution documentation: http://docs.python.org/distutils/index.html and what I have figured out so far is that I basically need to write a setup.py script. Something like:

setup(name='Distutils',
  version='1.0',
  description='Python Distribution Utilities',
  author='My Name',
  author_email='My Email',
  url='some URL',
  package_dir={'': 'src'},
  packages=[''],
 )

I would like to ensure that my program uses 2.6 interpreter library when user install it on their box. What would be the best approach to ensure that my program uses 2.6 ? Shall I distribute python 2.6 library along with my program ? Is there any alternative approach ?

A: 

Check sys.hexversion and make sure that it's greater than or equal to 0x02060000.

Ignacio Vazquez-Abrams
sys.hexversion basically check the python version number that the user has in their box. I would like to ensure that the user box execute my python program with 2.6 interpreter.Thanks
zfranciscus
No, it returns the version of the interpreter it's running under.
Ignacio Vazquez-Abrams
You should run the version you want, not run the wrong one and then complain. *Most* systems have more than one version of Python installed, so running as "python" when you need 2.6 is guaranteed to cause problems. (There's no way to ask for "the latest 2.x", unfortunately.)
Glenn Maynard
+1  A: 
Michael Aaron Safyan
Thanks, Michael this has been really helpful
zfranciscus