Skip to content Skip to sidebar Skip to footer

Launching Python Subprocess Has Different Behavior Depending On Launcher

I'm attempting to launch Python 2.5 from Python 2.6. The reason for this is a compiled library I'm trying to use (GDAL) isn't supported for the version of Python distributed with

Solution 1:

Regardless of whether PATH is correct, a simple test would be to change to a different arbitrary directory and do python.exe C:\full\path\to\main.py. If that reproduces the problem then you know it's some sort of path problem.

Check sys.path, I'll bet that's where the difference is. If that's the case, you probably need to alter the way you make your Python code and libraries are accessible from python.exe, either using the site module or using something else like zc.buildout/zc.recipe.egg's support for generating console_scripts with the correct sys.path baked in.

Solution 2:

It appears from comments posted elsewhere that

"The working one is C:\Windows and the broken one is C:\Program Files\ArcGIS...\Bin."

Do a os.chdir to make it work.

[No idea what this really means, the comment was hard to parse.]

Post a Comment for "Launching Python Subprocess Has Different Behavior Depending On Launcher"