Answer the question
In order to leave comments, you need to log in
How to connect PyQt-win to Python?
I want to try to make a window application in Python under Windows
I downloaded and installed python. Console examples work fine.
When sending the window example for compilation, it gives an error:
Traceback (most recent call last):
File "D:\win.pyw", line 2, in from PyQt4.QtGui import * # interface components
ImportError: No module named 'PyQt4'
code here such:
import sys
from PyQt4.QtGui import * # компоненты интерфейса
# Каждое приложение должно создать объект QApplication
# sys.argv - список аргументов командной строки
application = QApplication(sys.argv)
# QWidget - базовый класс для всех объектов интерфейса
# пользователя; если использовать для виджета конструктор
# без родителя, такой виджет станет окном
widget = QWidget()
widget.resize(320, 240) # изменить размеры виджета
widget.setWindowTitle("Hello, World!") # установить заголовок
widget.show() # отобразить окно на экране
sys.exit(application.exec_())
Answer the question
In order to leave comments, you need to log in
Look towards pip . This wonderful thing can install packages itself (as well as delete, update, etc.).
Installation will fit in just one line: pip install pyqt
There are exe files here, these are ready-made installers.
In the archive, the sources, judging by the README, they will have to be collected, and this is most likely a big hemorrhoids.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question