简体   繁体   中英

installing pyqt4 on python 3.7

I am trying to build GUI applications using Python. I was previously using Python 3.4 and had PyQt4 installed in my PC. The following code snippet was running well:

import sys
from PyQt4 import QtSql, QtCore, QtGui, uic

Now, I have just installed Python 3.7 on my laptop and have uninstalled Python 3.4. I am receiving a ModuleNotFoundError, even though PyQt is installed (ModuleNotFoundError: No module named 'PyQt4')

Is there a way I can install PyQt4 for Python 3.7?

Look at this link :

PyQt4 and Qt v4 are no longer supported and no new releases will be made. PyQt5 and Qt v5 are strongly recommended for all new development.

So you have to install PyQt5 instead, PyQt5 is very similar to PyQt4, some basic differences:

  • Most of the methods in QtGui of PyQt4 is moved to QtWidgets at PyQt5.

  • PyQt4's old-style signals are not implemented in PyQt5.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM