0

The problem that I have right now is that I require a specific version of python in order for the source code that I have to work. To make this source code more accessible to everyone, I don't want people to have to go through the hassle to downloading the right python version. Instead is there a way to incorporate the right python version right into my program or any way to localize Python?

Jon Clements
  • 138,671
  • 33
  • 247
  • 280
  • 1
    IMHO you would be better off fixing your code to work in more versions of Python... – martineau Jul 17 '13 at 16:34
  • IS there any easy or good trick into doing this? – user2574069 Jul 17 '13 at 16:50
  • If you want Python2.7 to Python 3 conversion, look at [Python2to3](http://docs.python.org/2/library/2to3.html) – Sukrit Kalra Jul 17 '13 at 16:52
  • Do you basically mean that you want to package up a whole python environment for distribution with your code? If so, say that. – Marcin Jul 17 '13 at 16:53
  • Usually it's just a matter of finding the lowest common denominator because Python is generally backwards-compatible with earlier versions of itself (unless your talking about versions 2 & 3). Alternatively, if the language syntax hasn't changed, which is usually the case, you can always just check `sys.version` and do different things depending on what version is being used -- although that's seldom worth the trouble. If you get stumped on how to handle something in particular, you can always ask for help with it here... – martineau Jul 17 '13 at 17:00
  • have a look at this question: http://stackoverflow.com/questions/14165398/a-good-python-to-exe-compiler – Paul Collingwood Jul 17 '13 at 19:44

1 Answers1

1

Not sure how this would work out, but the only thing I can think of is creating a virtual environment with the required python version, and then sharing that with people. Not the ideal solution, and I'm sure others can suggest something better.

KGo
  • 18,536
  • 11
  • 31
  • 47