From ca47064020d9f07d4dfa7a203fe7834fc7fa1562 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 20 Jun 2022 13:55:25 +0200 Subject: [PATCH] Python: Fix scripts path to global/venv pyside installations ... when checking for pyside tools. Change-Id: I1aaac9dd9da76f08ada031cc88761dba36c4e3b6 Reviewed-by: Christian Stenger --- src/plugins/python/pythonrunconfiguration.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index a04d2b723a7..9882cfb5fb0 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -236,7 +236,12 @@ 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"); + // Scripts is next to the site-packages install dir for user installations + FilePath scripts = info.location.parentDir().pathAppended("Scripts"); + if (!scripts.exists()) { + // in global/venv installations Scripts is next to Lib/site-packages + scripts = info.location.parentDir().parentDir().pathAppended("Scripts"); + } auto userInstalledPySideTool = [&](const QString &toolName) { const FilePath tool = scripts.pathAppended(HostOsInfo::withExecutableSuffix(toolName)); return tool.isExecutableFile() ? tool : FilePath();