diff --git a/tools/nitpick/src/PythonInterface.cpp b/tools/nitpick/src/PythonInterface.cpp index dcf4ecc682..48ca3b30e0 100644 --- a/tools/nitpick/src/PythonInterface.cpp +++ b/tools/nitpick/src/PythonInterface.cpp @@ -16,12 +16,16 @@ QString PythonInterface::getPythonCommand() { #ifdef Q_OS_WIN if (_pythonCommand.isNull()) { - QString pythonPath = PathUtils::getPathToExecutable("python.exe"); + // Use the python launcher as we need python 3, and python 2 may be installed + // See https://www.python.org/dev/peps/pep-0397/ + const QString pythonLauncherExecutable{ "py.exe" }; + QString pythonPath = PathUtils::getPathToExecutable(pythonLauncherExecutable); if (!pythonPath.isNull()) { _pythonCommand = pythonPath + _pythonExe; - } else { - QMessageBox::critical(0, "python.exe not found", - "Please verify that pyton.exe is in the PATH"); + } + else { + QMessageBox::critical(0, pythonLauncherExecutable + " not found", + "Please verify that py.exe is in the PATH"); exit(-1); } } @@ -35,4 +39,4 @@ QString PythonInterface::getPythonCommand() { #endif return _pythonCommand; -} +} \ No newline at end of file diff --git a/tools/nitpick/src/PythonInterface.h b/tools/nitpick/src/PythonInterface.h index 7972d55cce..d51b51d007 100644 --- a/tools/nitpick/src/PythonInterface.h +++ b/tools/nitpick/src/PythonInterface.h @@ -18,7 +18,7 @@ public: private: #ifdef Q_OS_WIN - const QString _pythonExe{ "python.exe" }; + const QString _pythonExe{ "py.exe" }; #else // Both Mac and Linux use "python" const QString _pythonExe{ "python" }; @@ -27,4 +27,4 @@ private: QString _pythonCommand; }; -#endif // hifi_PythonInterface_h +#endif // hifi_PythonInterface_h \ No newline at end of file