Qt5 and QtQuick 2 bindings for Python 2.7

2019-08-07 12:58发布

问题:

I want to use Qt5 and QtQuick2 with a binding such as PyQt, but it seems the only builds available for PyQt are for Python 3.3. Are there any bindings I can use with Python 2.7?

回答1:

I assume you're talking about binary installers for Windows. The maintainer of PyQt5 has made it very clear that he will not be providing them for PyQt5/Python2:

>>> Are there any Windows binary installers for PyQt5 and Python 2.7?
>>
>> No, and I don't intend to provide any.
>
> Thanks. Any particular reason?

  1. Incompatibilities between dependencies and compiler versions - there would be no support for QtWebKit.

  2. I'm trying to limit the total number of installer I maintain.

  3. I'm doing my bit to encourage people to move to Py3.

PyQt5 for Py2 is fully supported, so there is nothing to stop anybody else doing the work.

So you'd better have a very good reason for insisting on using Python2 with PyQt5, because you'll be commited to either maintaining Windows builds yourself, or relying on a third party to do it for you.

If you do a little web-searching, you will find a few binary installers out there, as well as instructions/tutorials for buidling them yourself. But I'm not going to endorse any of them here, because I haven't tried any of them myself (and have no intention of doing so).