diff --git a/avogadro/qtplugins/configurepython/configurepython.cpp b/avogadro/qtplugins/configurepython/configurepython.cpp index 4906d0db6b..32ce4ca041 100644 --- a/avogadro/qtplugins/configurepython/configurepython.cpp +++ b/avogadro/qtplugins/configurepython/configurepython.cpp @@ -148,9 +148,13 @@ QStringList ConfigurePython::pythonPaths() const QStringList paths = findExecutablePaths(names); - // Add the current interpreter to the list if it's not already there. - if (!paths.contains(pythonInterp)) - paths.prepend(pythonInterp); + // Add the current interpreter to the list if it's not already there + // and it exists as an executable + if (!paths.contains(pythonInterp)) { + QFileInfo info(pythonInterp); + if (info.exists() && info.isExecutable()) + paths.prepend(pythonInterp); + } return paths; }