mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 16:23:17 +02:00
Updated python interface.
This commit is contained in:
parent
9b8f079899
commit
68f9b473a6
2 changed files with 11 additions and 7 deletions
|
@ -16,12 +16,16 @@
|
||||||
QString PythonInterface::getPythonCommand() {
|
QString PythonInterface::getPythonCommand() {
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
if (_pythonCommand.isNull()) {
|
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()) {
|
if (!pythonPath.isNull()) {
|
||||||
_pythonCommand = pythonPath + _pythonExe;
|
_pythonCommand = pythonPath + _pythonExe;
|
||||||
} else {
|
}
|
||||||
QMessageBox::critical(0, "python.exe not found",
|
else {
|
||||||
"Please verify that pyton.exe is in the PATH");
|
QMessageBox::critical(0, pythonLauncherExecutable + " not found",
|
||||||
|
"Please verify that py.exe is in the PATH");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,4 +39,4 @@ QString PythonInterface::getPythonCommand() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return _pythonCommand;
|
return _pythonCommand;
|
||||||
}
|
}
|
|
@ -18,7 +18,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
const QString _pythonExe{ "python.exe" };
|
const QString _pythonExe{ "py.exe" };
|
||||||
#else
|
#else
|
||||||
// Both Mac and Linux use "python"
|
// Both Mac and Linux use "python"
|
||||||
const QString _pythonExe{ "python" };
|
const QString _pythonExe{ "python" };
|
||||||
|
@ -27,4 +27,4 @@ private:
|
||||||
QString _pythonCommand;
|
QString _pythonCommand;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_PythonInterface_h
|
#endif // hifi_PythonInterface_h
|
Loading…
Reference in a new issue