John
John

Reputation: 41

problems with PyQt4 and Python 3.5

I'm using python 3.5.1 64 bit. My operating system is Windows 10. I installed: pip install PyQt4-4.11.4cp35-none-win_64.whl from gohlke site. pip says it was installed successfully. I can import PyQt4 but none of the modules in it. It is installed in site-packages. When I open the PyQt folder I find: QtCore.pyd and QtCore.dll, but when I try to import them I get a message that they aren't found. The program is from Summerfield's book. Here it is:

import sys
import time
import PyQt4
from PyQt4.QtCore import *
from PyQt4.QtGui import *

app = QApplication(sys.argv)

try:
    due = QTime.currentTime()
    message = "Alert!"
    if len(sys.argv) < 2:
        raise ValueError
    hours, mins = sys.argv[1].split(":")
    due = QTime(int(hours), int(mins))
    if not due.isValid():
        raise ValueError
    if len(sys.argv) > 2:
        message = " ".join(sys.argv[2:])
except ValueError:
        message = "Usage: alert.pyw HH:MM [optional message]" #24hr clock

while QTime.currentTime() < due:
        time.sleep(20)

label = QLabel("<font color=red size=72><b>" + message + "</b></font>")
label.setWindowFlags(Qt.SplashScreen)
label.show()
QTimer.singleShot(60000, app.quit)
app.exec()

Upvotes: 3

Views: 2894

Answers (1)

Chytry
Chytry

Reputation: 367

I solved this problem. I didn't have msvcp140. Install Visual C++ Redistributable for Visual Studio 2015 and propably will be fine. I also changed PyCharm version to 4.5.4

Upvotes: 2

Related Questions