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

1.5k views Asked by At

Downloaded SIP 4.16.4.zip(windows source) from riverbankcomputing - Unpacked and ran configure.py from within the folder. Sub-Directories sipgen, sip-lib are now in the Python34 directory along with sipconfig.py and Makefile.

I am unable to run any of the Makefiles either in the sipgen/sip-lib sub folders or in the main Python34 folder. Ran the installer for Py3.4-Qt5.3.1-x64 and the following test code from within PyCharm3.4.1

The code runs with exit code 0, but within the PyCharm editor, the import statements are flagged as

Cannot find reference 'QtCore' in '__init__.py'

and

Cannot find reference 'QtWidgets' in '__init__.py'

The Qt***.pyd (QWidget, QLabel, etc) files from:
Python34\lib\site-packages\PyQt5
used in the code are flagged by PyCharm as Unresolved reference.

My goal is to install PyQt5.3.1x64 for Python 3.4x64 on Windows 8.1 - I have searched extensively and most of the doc/posts I've encountered are for Visual Studio applications or leads off into some tangent that is not applicable.

I'm looking for a concise procedure to install on windows and am not sure if I should also install some base QT by running qt-opensource-windows-x86-1.6.0-6-online.exe installer.
I believe the problem is with not being able to run the make and make install steps for the Windows environment. There is a Makefile in each of the following directories...
Python34: python34\sipgen and python34\siplib

Do I need to run a make and install using each of these and if so how is this done on Windows 8.1?

TEST CODE

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_())
1

There are 1 answers

0
Jim On

In another post it was suggested that the unresolved references are caused by a bug in PyCharm. The code runs fine but the IDE sets flags throughout for all the Qt components. If anyone else is trying to install sip and Qt5 on windows 8 and needs help contact me and I will be glad to give step by step instructions using Visual Studio Developer Command Prompt.