[Scons-dev] Trouble running scons with multiple pythons and a set PYTHONPATH and set PYTHONHOME

Ivan Nedrehagen ivan.nedrehagen at loqal.no
Fri Aug 2 02:44:27 EDT 2013


I and several other users in my company have a problem with starting up a
freshly installed scons
on windows.

The problem are that we have all several python version install and
actively use the PYTHONPATH and PYTHONHOME
environment variable to control which version of python is used.

When running SCons we use the script scons.bat in the Scripts folder, and
it is supposed to use the python that is used in the outer folder, but
with the PYTHONPATH and PYTHONHOME set this fails. At first when starting
with SCons it took me a long time to figure out what was amiss, now I
patch every scons.bat with these lines:

set PYTHONPATH=%~dp0..
set PYTHONHOME=%~dp0..

inserted right after the "@REM ensure the script will be executed with the
Python it was installed for"

I was wondering if this isn't an improvement of the scons.bat script? If
it is not, some kind of warning
to get the attention of the user should be in place. Now you just get an
obscure python error.

If it would be of interest I could write a patch that checks if the
variables exits, and change them with a warning, or simply only warns if
it could be of use. Alternatively just change the values without any
warning at all.


More information about the Scons-dev mailing list