簡體   English   中英

在Windows 8.1上為Python 3.4 x64安裝SIP 4.16.4和PyQt5.3.1

[英]Installing SIP 4.16.4 and PyQt5.3.1 for Python 3.4 x64 on Windows 8.1

從下載SIP 4.16.4.zip( 窗口源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語句被標記為

在'__init__.py'中找不到引用'QtCore'

在'__init__.py'中找不到引用'QtWidgets'

來自以下位置的Qt***.pyd (QWidget,QLabel等)文件:
Python34 \\ lib \\ site-packages \\ PyQt5
代碼中使用的PyCharm標記為Unresolved reference

我的目標是在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 install步驟。 以下每個目錄中都有一個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_())

在另一篇文章中,有人提出未解決的引用是由PyCharm中的錯誤引起的。 該代碼運行良好,但是IDE會為所有Qt組件始終設置標志。 如果有人嘗試在Windows 8上安裝sip和Qt5,並且需要幫助,請與我聯系,我將很高興使用Visual Studio Developer Command Prompt提供逐步指導。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM