Compare commits

...

2 Commits

Author SHA1 Message Date
Jean-Baptiste Mardelle
fd573f9f84 Ensure we copy the python executables and don't symlink - on AppImage the link would be invalidated on each run 2025-04-17 04:02:04 +02:00
Jean-Baptiste Mardelle
d6640ce2d8 Try using packaged python on AppImage 2025-04-16 18:27:23 +02:00

View File

@@ -257,7 +257,17 @@ QString AbstractPythonInterface::systemPythonExec()
deps.close();
}
#endif
const QString path = QStandardPaths::findExecutable(pythonName);
// On Windows, Mac and AppImage, use our packaged python
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
QStringList paths = {qApp->applicationDirPath()};
#else
QStringList paths;
if (pCore->packageType() == LinuxPackageType::AppImage) {
paths << qApp->applicationDirPath();
}
#endif
const QString path = QStandardPaths::findExecutable(pythonName, paths);
if (path.isEmpty()) {
setStatus(Broken);
Q_EMIT setupError(i18n("Cannot find %1, please install it on your system.\n"
@@ -408,7 +418,8 @@ bool AbstractPythonInterface::setupVenv()
QProcess envProcess;
// For some reason, this fails in AppImage, but when extracting the Appimage it works...
// No workaround found yet for AppImage
QStringList args = {QStringLiteral("-m"), QStringLiteral("venv"), pluginDir.absoluteFilePath(getVenvPath())};
QStringList args = {QStringLiteral("-m"), QStringLiteral("venv"), pluginDir.absoluteFilePath(getVenvPath()), QStringLiteral("--upgrade-deps"),
QStringLiteral("--copies")};
envProcess.start(pythonExec, args);
envProcess.waitForStarted();
envProcess.waitForFinished(-1);