Browse Source

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)>
```
patch-4
SomberNight 3 years ago
parent
commit
8e234f3ccd
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 1
      electrum/gui/qt/__init__.py

1
electrum/gui/qt/__init__.py

@ -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'")

Loading…
Cancel
Save