From ff8495b0a2e4a769ccec5fe2a254a7593418ab18 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 2 Jun 2022 14:40:11 +0200 Subject: [PATCH] Python: fix pyside tool detection pip might return an incomplete list of files on Windows for installations. So we need to manually check the Scripts folder for the tools we are looking for. Change-Id: I40778607fd2f2015059744f17a539ca381b85560 Reviewed-by: Christian Stenger --- src/plugins/python/pythonrunconfiguration.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index c88bbb26629..fc8a367da45 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -229,6 +229,19 @@ void PythonRunConfiguration::currentInterpreterChanged() } } + // Workaround that pip might return an incomplete file list on windows + if (HostOsInfo::isWindowsHost() && !python.needsDevice() + && !info.location.isEmpty() && m_pySideUicPath.isEmpty()) { + const FilePath scripts = info.location.parentDir().pathAppended("Scripts"); + auto userInstalledPySideTool = [&](const QString &toolName) { + const FilePath tool = scripts.pathAppended(HostOsInfo::withExecutableSuffix(toolName)); + return tool.isExecutableFile() ? tool : FilePath(); + }; + m_pySideUicPath = userInstalledPySideTool("pyside6-uic"); + if (pySideProjectPath.isEmpty()) + pySideProjectPath = userInstalledPySideTool("pyside6-project"); + } + updateExtraCompilers(); if (auto pySideBuildStep = buildSteps->firstOfType())