下载了sip4.16.4.zip(windows source)从riverbankcomputing-解包并在文件夹中运行configure.py
。子目录sipgen、sip lib现在与sipconfig.py
和Makefile一起位于Python34
目录中。在
我无法运行sipgen/sip lib子文件夹或主Python34
文件夹中的任何makefile。从PyCharm3.4.1中运行Py3.4-Qt5.3.1-x64的安装程序和以下测试代码
代码使用退出代码0运行,但是在PyCharm编辑器中,import语句被标记为
Cannot find reference 'QtCore' in '__init__.py'
以及
Cannot find reference 'QtWidgets' in '__init__.py'
Qt***.pyd
(QWidget、QLabel等)文件来自:
Python34\lib\site packages\PyQt5
在代码中使用的被PyCharm
标记为未解析的引用。在
我的目标是在windows8.1上安装python3.4x64的PyQt5.3.1x64—我已经进行了广泛的搜索,我遇到的大多数文档/帖子都是针对visualstudio应用程序的,或者导致一些不适用的切线。在
我正在寻找一个简洁的过程来安装在windows上,我不确定是否也应该通过运行QT-opensource-windows-x86-1.6.0-6来安装一些基本的QT-联机.exe安装程序。
我认为问题在于无法在Windows环境下运行make和make安装步骤。在以下每个目录中都有一个Makefile…
Python34:Python34\sipgen和Python34\siplib
我需要使用每一个来运行make and install吗?如果需要,在windows8.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_())
在另一篇文章中,有人认为未解析的引用是由PyCharm中的一个bug引起的。代码运行良好,但IDE为所有Qt组件设置标志。如果有人试图在Windows8上安装sip和Qt5,需要帮助,请与我联系,我很乐意使用VisualStudioDeveloper命令提示符一步一步地给出说明。在
相关问题 更多 >
编程相关推荐