Fixed No Qt platform plugin could be initialized error

This commit is contained in:
Deniz Şafak
2025-09-14 21:48:08 +03:00
parent 023884d6d8
commit 6834d223c9
2 changed files with 17 additions and 0 deletions
+3
View File
@@ -1,3 +1,6 @@
# 1.1.8 (pre-release)
- Fixed `No Qt platform plugin could be initialized` error, mentioned in #59 by @sunrainxyz
# 1.1.7 # 1.1.7
- Added MPS GPU acceleration support for Silicon Mac, mentioned in https://github.com/denizsafak/abogen/issues/32#issuecomment-3155902040 by @jefro108. **Please read the [Mac](https://github.com/denizsafak/abogen?tab=readme-ov-file#mac) section in the documentation again, as it requires additional configuration.** - Added MPS GPU acceleration support for Silicon Mac, mentioned in https://github.com/denizsafak/abogen/issues/32#issuecomment-3155902040 by @jefro108. **Please read the [Mac](https://github.com/denizsafak/abogen?tab=readme-ov-file#mac) section in the documentation again, as it requires additional configuration.**
- Added word-by-word karaoke highlighting feature by @robmckinnon in PR #65 - Added word-by-word karaoke highlighting feature by @robmckinnon in PR #65
+14
View File
@@ -4,6 +4,20 @@ import sys
import platform import platform
import atexit import atexit
import signal import signal
# Qt platform plugin detection (fixes #59)
try:
from PyQt5.QtCore import QLibraryInfo
plugins = QLibraryInfo.location(QLibraryInfo.PluginsPath)
platform_dir = os.path.join(plugins, "platforms")
if os.path.isdir(platform_dir):
os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = platform_dir
print("QT_QPA_PLATFORM_PLUGIN_PATH set to:", platform_dir)
else:
print("PyQt5 platform plugins not found at", platform_dir)
except ImportError:
print("PyQt5 not installed.")
from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import QApplication
from PyQt5.QtGui import QIcon from PyQt5.QtGui import QIcon
from PyQt5.QtCore import qInstallMessageHandler, QtMsgType from PyQt5.QtCore import qInstallMessageHandler, QtMsgType