diff --git a/Cantera/python/Cantera/__init__.py b/Cantera/python/Cantera/__init__.py index 1f05f195a..8fc7ba34b 100755 --- a/Cantera/python/Cantera/__init__.py +++ b/Cantera/python/Cantera/__init__.py @@ -12,6 +12,14 @@ from gases import * from set import set from importFromFile import * +import os as _os +import sys as _sys + +if not os.getenv('PYTHON_CMD'): + # Setting PYTHON_CMD here avoids issues with .cti -> .xml conversions + # in cases where the python interpreter isn't in the system path. + os.environ['PYTHON_CMD'] = _sys.executable + def writeCSV(f, list): """ Write list items to file 'f' in diff --git a/Cantera/src/base/ct2ctml.cpp b/Cantera/src/base/ct2ctml.cpp index 591d599fb..4064ed126 100644 --- a/Cantera/src/base/ct2ctml.cpp +++ b/Cantera/src/base/ct2ctml.cpp @@ -64,7 +64,7 @@ namespace ctml { if (!py) { const char* hm = getenv("HOME"); string home = stripws(string(hm)); - string cmd = string("source ")+home + string cmd = string(". ")+home +string("/setup_cantera &> /dev/null"); system(cmd.c_str()); py = getenv("PYTHON_CMD");