OPUS and Multiple Versions of Python

Problem

Opus 4.3 ships with Python 2.6. A number of third party unrelated programs such as ArcGIS (9.3.1) and Quantum GIS (1.5.0) ship with a python 2.5 dependency. This can cause problems in resolving by the respective programs which version of python to load, and which libraries to use. (Third party libraries are often created for a specific release of Python. If the wrong version is loaded, those libraries may not work).

On Windows XP I found that having the PATH environment variable set to python version 2.6 would compromise both Quantum GIS which could not load with python support at all, jeopardizing geoprocessing capabilities as well as the python plugin manager.

With ArcMap?, I ran into geoprocessing problems where python was needed.

OPUS does not alter PATH or PYTHONPATH environment variables; if you have an existing Python 2.5 installation and programs depending on it, installing OPUS should not cause problems. If you rely on a provider such as Enthought, you will likely have 2.6 dependencies written to these variables.

Solution

A solution which seems to work is to remove all references in the PATH variable to python 2.6 and set this to 2.5 in stead. OPUS/urbansim has an explicit resolution of this so it does not need the PATH (nor the PYTHONPATH) variable(s) to run UrbanSim?. Do beware if you have other programs depending on Python 2.6; this solution will not be advisable in such a situation. This is strictly a way to deal with a situation where existing programs run with Python 2.5 whereas the newer versions of OPUS run with 2.6.

If using Eclipse, it will be necessary to manually point to third party libraries as it usually gets those references from the PYTHONPATH variable. This can be achieved easily by selecting Window->Preferences. Then under PyDev? on the left, select Interpreter - Python and under Libraries, point to relevant folders, such as /Python26/Lib/site-packages/

EclipsePythonPath.PNG--

AkselOlsen - 17 Aug 2010

Topic attachments
I Attachment Action Size Date Who Comment
pngPNG EclipsePythonPath.PNG manage 140.1 K 17 Aug 2010 - 18:25 AkselOlsen eclipse pythonpath
Topic revision: r2 - 17 Aug 2010 - 18:42:24 - AkselOlsen
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback