Normalize platformpath

This commit is contained in:
Deniz Şafak
2025-10-19 17:17:40 +03:00
parent 42336145dd
commit ccb350fa08
+4 -1
View File
@@ -9,7 +9,10 @@ import signal
try: try:
from PyQt5.QtCore import QLibraryInfo from PyQt5.QtCore import QLibraryInfo
plugins = QLibraryInfo.location(QLibraryInfo.PluginsPath) plugins = QLibraryInfo.location(QLibraryInfo.PluginsPath)
platform_dir = os.path.join(plugins, "platforms") # Normalize path to use the OS-native separators and absolute path
platform_dir = os.path.normpath(os.path.join(plugins, "platforms"))
# Ensure we work with an absolute path for clarity
platform_dir = os.path.abspath(platform_dir)
if os.path.isdir(platform_dir): if os.path.isdir(platform_dir):
os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = platform_dir os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = platform_dir
print("QT_QPA_PLATFORM_PLUGIN_PATH set to:", platform_dir) print("QT_QPA_PLATFORM_PLUGIN_PATH set to:", platform_dir)