pyqt / python-qt5

Unofficial PyQt5 via PyPI for Python 2.7 64-bit on Windows
GNU General Public License v3.0
280 stars 78 forks source link

QML Not working #16

Closed nikialeksey closed 8 years ago

nikialeksey commented 9 years ago

Hello! I have a problem with qml: i can't start my app on python2.7. This is my python code main.py:

from PyQt5.QtCore import QUrl, QObject, pyqtSlot
from PyQt5.QtGui import QGuiApplication
from PyQt5.QtQuick import QQuickView

if __name__ == '__main__':
    import sys

    app = QGuiApplication(sys.argv)

    view = QQuickView()
    view.setResizeMode(QQuickView.SizeRootObjectToView)
    view.setSource(
        QUrl.fromLocalFile('main.qml')
    )
    view.show()

    sys.exit(app.exec_())

and qml code main.qml:

import QtQuick 2.0

Rectangle {
    width: 500
    height: 400
}
mottosso commented 9 years ago

Hi @nikialeksey, thanks for sharing.

However, your example works well for me. Could you post the exact error message, and a step-by-step on how you installed python-qt5?

nikialeksey commented 9 years ago

Ok! I install python2 as Anaconda on my Windows 8.1 64 bit (https://store.continuum.io/cshop/anaconda/), then I call C:\Anaconda\Scripts\pip.exe install python-qt5 and it worked fine. After install I tried to run my program (python + qml) but my PyCharm told me

C:\Anaconda\python.exe E:/qt-workspace/testPyQT5/main.py
Process finished with exit code -1073741819 (0xC0000005)

Sorry for my bad english.

mottosso commented 9 years ago

Hm, I'm not familiar with either Anaconda or PyCharm.

What happens when you try running it from the command-line?

$ python main.py
nikialeksey commented 9 years ago

I remove my Anaconda and install python 2.7 from official site for am64 acrh and run python main.py from command line. Windows show me "programm python.exe doesn't work". It's magic) In PyCharm the same thing is happening.

mottosso commented 9 years ago

Hey @nikialeksey, have you found a solution yet? I'm still not noticing these problems over here :(

nikialeksey commented 9 years ago

Hi) not yet. Finally I took PyQt5 with SIP and it works fine for me, but i got a problem with deploy. So I want to try python-qt5 install on python with other architecture. I will let you know if I solved this problem!

mottosso commented 9 years ago

Ok, good luck!

mottosso commented 8 years ago

Assuming this worked out for you, let me know otherwise.