1
0

qt gui: better detection of missing PyQt5 at startup

If I use apt on ubuntu to install python3-pyqt5 and then remove it, it leaves an empty namespace:
```
$ python3
Python 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5
>>> import PyQt5.QtGui
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'PyQt5.QtGui'
>>> PyQt5
<module 'PyQt5' (namespace)>
```
This commit is contained in:
SomberNight
2022-04-11 17:37:10 +02:00
parent 70fb4bf538
commit 8e234f3ccd

View File

@@ -33,6 +33,7 @@ from typing import Optional, TYPE_CHECKING, List
try:
import PyQt5
import PyQt5.QtGui
except Exception:
sys.exit("Error: Could not import PyQt5 on Linux systems, you may try 'sudo apt-get install python3-pyqt5'")