--- a/src/eric7/Globals/__init__.py Tue Oct 18 17:02:51 2022 +0200 +++ b/src/eric7/Globals/__init__.py Tue Oct 18 17:48:03 2022 +0200 @@ -15,6 +15,7 @@ import os import re import sys +import sysconfig from PyQt6.QtCore import ( QByteArray, @@ -274,9 +275,17 @@ @return path to the Python library directory @rtype str """ - import sysconfig + return sysconfig.get_path("platlib") + - return sysconfig.get_path("platlib") +def getPythonScriptsDirectory(): + """ + Function to determine the path to Python's scripts directory. + + @return path to the Python scripts directory + @rtype str + """ + return sysconfig.get_path("scripts") def getPyQt6ModulesDirectory(): @@ -402,15 +411,10 @@ program = "designer" if isWindowsPlatform(): program += ".exe" - dirName = os.path.dirname(sys.executable) - if os.path.exists(os.path.join(dirName, program)): - binPath = dirName - elif os.path.exists(os.path.join(dirName, "Scripts", program)): - binPath = os.path.join(dirName, "Scripts") - else: - dirName = os.path.dirname(sys.executable) - if os.path.exists(os.path.join(dirName, program)): - binPath = dirName + + progPath = os.path.join(getPythonScriptsDirectory(), program) + if os.path.exists(progPath): + binPath = getPythonScriptsDirectory() return QDir.toNativeSeparators(binPath)