[PyQt] PyQt4 and PyQt5 together on Linux?

Scott Kitterman debian at kitterman.com
Mon Mar 9 16:46:55 GMT 2015


On March 9, 2015 11:37:05 AM EDT, Sibylle Koczian <nulla.epistola at web.de> wrote:
>Hello,
>
>Am 05.03.2015 um 05:30 schrieb Scott Kitterman:
>> On Wednesday, March 04, 2015 05:58:18 PM Sibylle Koczian wrote:
>>> Hello,
>>>
>>> because I can't use PyQt5 for database applications I installed
>PyQt4 on
>>> Ubuntu 10.14 in addition to the existing PyQt5 installation. I've
>used
>>> the package manager for both, no visible problems installing. I did
>>> install the PyQt$-SQL package.
>>>
>>> But: if I try to connect to a PostgreSQL database I get the message
>that
>>> the driver QPSQL isn't available. The list of available drivers only
>>> contains QSQLITE, QSQLITE3, QMYSQL.
>>>
>>> With PyQt5 I can access PostgreSQL databases from that same
>(virtual)
>>> machine, but as I wrote on February 11 adding new data to a
>qtableview
>>> doesn't work as expected.
>>>
>>> What is wrong and what should I do?
>>>
>> For PyQt4, the Ubuntu package name for the SQL module is
>python-qt4-sql.  For
>> PyQt5 it's python-pyqt5.qtsql.  Not sure how you installed PyQt5
>using the
>> package manager though since 12.04 is the oldest supported Ubuntu
>release with
>> PyQt5 packages.
>>
>
>That was a bad typo: I meant Ubuntu 14.10! And I forgot to say that I 
>use Python 3, so I installed the packages python3-pyqt4, 
>python3-pyqt4.qtsql, python3-pyqt5 and python3-pyqt5.qtsql.
>
>I know that I can't install the binary packages for both PyQt4 and
>PyQt5 
>on Windows. On Linux I would have expected some sort of message by 
>Synaptic, if they can't be installed together. But installation without
>error messages, and then no QPSQL with PyQt4?

For Debian/Ubuntu we've packaged them to be co-installable. 

>Of course I'd prefer using PyQt5 anyway, if I knew how to keep new data
>in my QTableView.
>
>Sibylle

I'll leave the rest of your question for someone else. Do take care to only use Qt4 or Qt5 as mixing them in the same process is a recipe for failure. 

Scott K
Replying to the list on the assumption the offlist reply was in error. 


More information about the PyQt mailing list