Module not importing PyQt5 modules

Rich Shepard rshepard at appl-ecosys.com
Wed Jun 2 21:08:47 BST 2021


Running python3-PyQt5-5.13.2-x86_64-2_SBo and python3-3.7.2-x86_64-1_SBo on
Slackware-14.2/x86_64.

There's a module to connect to the PostgreSQL database that begins this way:
import sys
import logging

from PyQt5 import QtWidgets as qtw
from PyQt5 import QtGui as qtg
from PyQt5 import QtCore as qtc
from PyQt5 import QtSql as qts

class DBSetup(qts.QSqlDatabase):
     """ Set up database connection """
     def __init__(self, *args, **kwargs):
         super().__init__(self, *args, **kwargs)

         db = qts.QSqlDatabase.addDatabase('QPSQL')
         db.setDatabaseName('bustrac')
         logging.info('found database')
         print('Connected to bustrac database')
 	...

For some reason it's not importing the PyQt5 modules:
$ python -mpdb datasource.py 
> $ development/business_tracker/datasource.py(1)<module>()
-> import sys
(Pdb) s
> $ development/business_tracker/datasource.py(2)<module>()
-> import logging
(Pdb) s
--Call--
> <frozen importlib._bootstrap>(978)_find_and_load()
(Pdb)

What might I have done incorrectly?

TIA,

Rich


More information about the PyQt mailing list