从Riverbankcomputing下载 SIP 4.16.4.zip( windows source ) - 解压并从文件夹中运行。子目录 sipgen、sip-lib 现在与 Makefile 一起在目录中。configure.py
Python34
sipconfig.py
我无法在 sipgen/sip-lib 子文件夹或主Python34
文件夹中运行任何 Makefile。从 PyCharm3.4.1 中运行 Py3.4-Qt5.3.1-x64 的安装程序和以下测试代码
该代码以退出代码 0 运行,但在 PyCharm 编辑器中,导入语句被标记为
在“__init__.py”中找不到引用“QtCore”
和
在“__init__.py”中找不到引用“QtWidgets”
代码中使用的来自Python34\lib\site-packages\PyQt5的Qt***.pyd
(QWidget、QLabel 等)文件
被标记为Unresolved reference。
PyCharm
我的目标是在 Windows 8.1 上为 Python 3.4x64 安装 PyQt5.3.1x64 - 我进行了广泛的搜索,我遇到的大多数文档/帖子都是针对 Visual Studio 应用程序的,或者导致一些不适用的切线。
我正在寻找在 Windows 上安装的简明程序,但不确定是否还应该通过运行 qt-opensource-windows-x86-1.6.0-6-online.exe 安装程序来安装一些基本 QT。
我认为问题在于无法为 Windows 环境运行 make 和 make 安装步骤。在以下每个目录中都有一个Makefile ...
Python34: python34\sipgen 和 python34\siplib
我是否需要使用其中的每一个运行制作和安装,如果需要,如何在 Windows 8.1 上完成?
测试代码
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
class Form(QWidget):
def \__init__(self, parent=None):
super(Form, self).\__init__(parent)
nameLabel = QLabel("Name:")
self.nameLine = QLineEdit()
self.submitButton = QPushButton("&Submit")
buttonLayout1 = QVBoxLayout()
buttonLayout1.addWidget(nameLabel)
buttonLayout1.addWidget(self.nameLine)
buttonLayout1.addWidget(self.submitButton)
self.submitButton.clicked.connect(self.submitContact)
mainLayout = QGridLayout()
# mainLayout.addWidget(nameLabel, 0, 0)
mainLayout.addLayout(buttonLayout1, 0, 1)
self.setLayout(mainLayout)
self.setWindowTitle("Hello Qt")
def submitContact(self):
name = self.nameLine.text()
if name == "":
QMessageBox.information(self, "Empty Field",
"Please enter a name and address.")
return
else:
QMessageBox.information(self, "Success!",
"Hello %s!" % name)
if __name__ == '__main__':
import sys
app = QApplication(sys.argv)
screen = Form()
screen.show()
sys.exit(app.exec_())