QtQuickControls 2.0 with PyQt5
<p>I setup a virtualenv and installed pyqt5 (PyQt5-5.7-cp35-cp35m-manylinux1_x86_64.whl):</p>

<pre><code>virtualenv -p /usr/bin/python3.5 .
source bin/activate
pip install pyqt5
</code></pre>

<p>I created a basic.qml file:</p>

<pre><code>import QtQuick 2.7
import QtQuick.Controls 2.0

Rectangle {
    width: 300
    height: 100
    color: "red"
}
</code></pre>

<p>and tried to load it in my python code with:</p>

<pre><code>import sys
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication
from PyQt5.QtQuick import QQuickView

if __name__ == '__main__':
    myApp = QApplication(sys.argv)

    view = QQuickView()
    view.setSource(QUrl('basic.qml'))
    view.show()

    sys.exit(myApp.exec_())
</code></pre>

<p>It fails with</p>

<pre><code>file:///[...]/main.qml:2:1: plugin cannot be loaded for module "QtQuick.Controls": Cannot load library /[virtualenv]/lib/python3.5/site-packages/PyQt5/Qt/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.so: (libQt5QuickTemplates2.so.5: Can't open shared object file: File or directory not found) 
     import QtQuick.Controls 2.0 
     ^

Process finished with exit code 0
</code></pre>

<p>I checked. This file it complains about actually doesn't exist. But how can I install it? Does PyQt5 support QtQuickControls2 at all?</p>

<p>If I switch the import in basic.qml from <code>import QtQuick.Controls 2.0</code> to <code>import QtQuick.Controls 1.2</code>, it works. But I want to use the new controls.</p>

<p>This looks like a bug in PyQt5. The package is missing both <code>libQt5QuickTemplates2.so</code> and <code>libQt5QuickControls2.so</code>.</p>

<p>Hoping that the Qt 5.7 build contained by the PyQt 5.7 package and the official Qt 5.7 build available at qt.io are built in a fully binary compatible way, one possibility could be to download and install Qt 5.7 from qt.io, and copy the missing libraries into your virtualenv. For example:</p>

<pre><code>$ cp ~/Qt/5.7/gcc_64/lib/libQt5QuickTemplates2.* path/to/lib/python3.5/site-packages/PyQt5/Qt/lib
$ cp ~/Qt/5.7/gcc_64/lib/libQt5QuickControls2.* path/to/lib/python3.5/site-packages/PyQt5/Qt/lib
</code></pre>

python pyqt pyqt5 qtquickcontrols qtquickcontrols2