Changing Python Version

From CAC Documentation wiki
Revision as of 16:27, 30 September 2015 by Ad876 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

We have a few versions of Python on the system.

  • C:\Python25epd - Enthought Python 2.5.4 is the default. It has a large list of helpful libraries that are already tested.
  • C:\Python25 - For anyone who might prefer to use the python.org distribution of Python 2.5.1.
  • C:\Python26 - For those who need 2.6 language features. Popular numeric libraries aren't available for this release.
  • C:\Python30 - For those who need 3.0 language features. This new release changes the language. Most numeric libraries aren't available.

To choose a particular version of Python over the default, in a batch script or interactively, set the PYTHONHOME variable to the appropriate directory, then start up the command-line interpreter:

set PYTHONHOME=C:\Python30
C:\Python30\python myfile.py

If you fail to set PYTHONHOME, the executable will load its libraries from Python25epd.

In order to start IDLE, which is the integrated development environment (IDE) for all of the above versions of Python, enter:

%PYTHONHOME%\pythonw %PYTHONHOME%\Lib\idlelib\idle.pyw