【问题标题】:Installing SIP 4.16.4 and PyQt5.3.1 for Python 3.4 x64 on Windows 8.1在 Windows 8.1 上为 Python 3.4 x64 安装 SIP 4.16.4 和 PyQt5.3.1
【发布时间】:2014-11-29 03:53:56
【问题描述】:

riverbankcomputing 下载的 SIP 4.16.4.zip(windows 源代码) - 从文件夹中解压缩并运行 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 编辑器中,导入语句被标记为

在“__init__.py”中找不到引用“QtCore”

在“__init__.py”中找不到引用“QtWidgets”

Qt***.pyd(QWidget、QLabel 等)文件来自:
Python34\lib\site-packages\PyQt5
代码中使用的被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

我是否需要使用其中的每一个运行 make 和安装,如果需要,如何在 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_())

【问题讨论】:

    标签: python qt makefile python-sip


    【解决方案1】:

    在另一篇文章中,有人建议 未解决的引用 是由 PyCharm 中的错误引起的。代码运行良好,但 IDE 为所有 Qt 组件设置了标志。如果其他人尝试在 Windows 8 上安装 sip 和 Qt5 并需要帮助,请联系我,我很乐意使用 Visual Studio 开发人员命令提示符提供分步说明。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-31
      • 1970-01-01
      • 1970-01-01
      • 2014-01-18
      • 2014-07-30
      • 2016-09-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多