QT5: QTQuick.Controls version 2.12 is not found - qml

My Qt application is failing to start with the following error:
module "QtQuick.Controls" version 2.12 is not installed
My platform is Ubuntu 20.04.2 LTS. This is a well-known error on StackOverflow. Unfortunately, no answers have worked for me this far. I have exhausted all suggested remedies without any improvement. These are enumerated below:
Checking compatibility of Qt with QuickControls: I am using Qt 5.12.8 in QtCreator, and QtCreator 4.11.0. I installed Qt using sudo apt install qt5 default and sudo apt-get install qtcreator. According to the documentation (see here, Qt 5.12 is directly compatible with QtQuick 2.12:
Checking if I specified QtQuick as a dependency: In my .pro file, I have added QT += quick qml quickcontrols2
Checking if I have the right libraries: I have qtquickcontrols2-5-dev, qt5declarative5-dev, and qml-module-qtquick-controls. Furthermore, apt-cache search qtquick shows me that all the qtquick modules are there
Re-installing qtcreator: Some questions suggest re-installing QtCreator. I have tried this, but it had no effect
QML Emulation layer: I have configured my project to "Use QML emulation layer that is built with the selected Qt". However, this also had no effect
Having performed every one of these steps, and exhausted all StackOverflow questions and Github threads related to the topic, I still cannot find what is causing this issue.
I have additionally included some related questions that I've tried. Question 4 is perhaps the closest to mine, but was solved via the Yocto build system that I am not using:
import QtQuick.Controls 2.1 QML MODULE NOT FOUND
Error module "QtQuick" version 2.12 is not installed
Ubuntu QT install qt quick controls 2.1
Qt - Module "QtQuick.Controls" is not installed
I would be extremely appreciative of any advice on further resolving this matter.

You are missing the qml module for controls 2 because you have installed qml-module-qtquick-controls instead of qml-module-qtquick-controls2.
The QML engine will look for a module inside the path from QML2_IMPORT_PATH, by following the namespaces, so in this case QML2_IMPORT_PATH/QtQuick/Controls and QML2_IMPORT_PATH/QtQuick/Controls.2 (see version semantics documentation ). If in these folders it finds a qmldir file, it will parse it and look for any component that has at least 2 as major and something lower or equal to 12 as minor (allthough this particular qmldir doesn't state any components... it probably also reads the libqtquickcontrols2plugin.so or plugin.qmltypes)

Related

Fixing gnuradio deleted directory

I have been following this guide to install gnuradio 3.8 onto my Ubuntu 22.04.1 LTS, but I missed the instruction where it said "Ensure the "gitbranch" is maint-3.8", and mine said maint-3.10. After trying to install gr-iqbal, it gave me an error. For whatever reason, I thought that simply deleting the directory it was built in would let me reinstall it. It didn't.
I have tried using pybombs install gnuradio which gives me CMake Error: The source directory "/home/aboigoe/sdr/src/gnuradio" does not appear to contain CMakeLists.txt.
I have tried using pybombs rebuild gnuradio, but that obtains Package gnuradio is not installed into current prefix. Aborting.
To fix that, I tried using pybombs fetch gnuradio, which runs fine, but doesn't fix the previous error.
Finally, I tried pybombs remove gnuradio, but it says Package gnuradio is not installed. Aborting.
So you're working with pybombs! That makes this particular task easier: just delete the whole prefix, and start anew. The main thing you needed to build in that prefix was GNU Radio, and you built 3.10, and wanted 3.8, so that's a complete rebuild, anyways.
I assume you're following that guide (which comes, kind of, out of nowhere – GNU Radio has installation guides on their wiki, https://wiki.gnuradio.org) because you want exactly GNU Radio 3.8, with gr-osmosdr and gr-iqbal.
If you just want a working GNU Radio that can talk to your SDR hardware, um, don't follow random guides from the internet :) Instead, your whole problem boils down to a simple
sudo apt install gnuradio
and that's it – GNU Radio 3.10, as Ubuntu 22.04 ships it, contains gr-soapy, and Ubuntu's apt will install many available hardware drivers (for RTL-SDR, hackrf, mirisdr, bladerf, audio-interfaced hardware, red pitaya,…) without any need to do anything yourself. It just works.
The thing that will be different is that the blocks to inteface with your hardware will not reside under the "osmosd" category in your GRC, but in "Soapy", but I guess you'll deal with that rather than going through the rather convoluted way of installing an old (and not updated anymore) version of GNU Radio, to include an old (and not updated anymore) version of gr-osmosdr :)

Unable to compile Qt5 examples. QCommandParser not found

I wanted to try out Qt5 with it's creator. I wanted to start with examples, so I installed some packages (with apt, also qtcreator package but issued the same with online-installer).
I am finally able to open examples, but those does not work.
I've tried to find every possible packages of qt in apt that may correspond to examples. Also tried to find package containing corresponding file (https://packages.ubuntu.com/search?searchon=contents&keywords=qcommandlineparser&mode=exactfilename&suite=disco&arch=any). It finds qtbase5-gles-dev, but I cannot install it since it wants me to uninstall a lot of software I need.
#include <QCommandLineParser>
#include <QCommandLineOption>
Both QCommandLineParser and Option are "file not found".
I'm on Kubuntu 19.04 and Qt Creator 4.8.1 based on Qt 5.12.2 (GCC 8.3.0, 64 bit)
According to this, I was running Qt kit as Qt4 not Qt5:
https://askubuntu.com/questions/916295/building-a-pro-in-qtcreator-gives-qtwidgets-no-such-file-or-directory
It is possible that the default qt build Kit has been set to qt 4.x rather than qt 5.x when qtcreator was installed. To update this;
qtcreator - options - build & run - Kits - Manual - Desktop (default)
- Qt version
Change Qt version from qt 4.x.. to qt 5.x.. in PATH (qt5).
Helped with delay...

Packaging with Pyinstaller - PyQt5 setStyle ignored

I'm actually have an similar issue as described here after update python, pyistaller, pyqt5, pyqt5-tools. Before I got the desired "Windows Vista-style" without app.setStyle('windowsvista') when I run the compiled stand-alone executable.
Now I got the Windows "Classic-style" instead. If I start the application in PyCharm it will use the desired "Windows Vista-style".
Currently installed on Win7 64bit:
Python : 3.6.4
PyInstaller: 3.3.1
PyQt5 : 5.10
pyqt5-tools: 5.9.0.1.2 (update to 5.9.1.1 doesn't work)
Does anyone have any idea why PyInstaller ignored the style?
The error seems to have been fixed in a unmerged branch of PyInstaller. More information can be found on the GitHub pull request conversation, but reinstalling PyInstaller using pip install https://github.com/bjones1/pyinstaller/archive/pyqt5_fix.zip fixed the same style issue for me on Mac.

Forced to install GDAL 1.11 framework by package for QGIS, and failing

To install QGIS on my MacBook Pro I need to install the gdal framework; however, the 1.11 framework package needed for QGIS is an empty file at kyngchaos. I tried installing GDAL 1.10 complete, but QGIS is requiring 1.11. I have Mavericks. I've installed each individual package: UnixImageIO, PROJ, GEOS, SQLite2, numpy, rgdal, and on... Now when I run the GDAL 1.11 framework install, everything seems to run until the last page, where an "Install Fail" page shows up. When I try to view the error, I'm taken out of the installer.
After some googling, I tried installing using homebrew. (brew install gdal)... I got a little further, but it tells me to "brew link libpng libtiff" -- and when I run that command, I get:
Linking /usr/local/Cellar/libpng/1.5.14... Warning: Could not link libpng. Unlinking...
Error: Could not symlink file: /usr/local/Cellar/libpng/1.5.14/share/man/man3/libpngpf.3
/usr/local/share/man/man3 is not writable. You should change its permissions.
After some more searching, it seems I could change permissions from usr/local to me, but I'm not sure how to (exactly) and don't want to mess anything up. Any help would be greatly appreciated, and my apologies if I'm missing something painfully obvious! I'm a novice at the programming end of things, so am just kind of pushing through everything like a bull in a china shop.
UPDATE:
Okay, I found the answer, even though it didn't seem to be working initially--
I ran the following commands from the GDAL help documentation:
export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH
sudo ln -sfh [ver] /Library/Frameworks/GDAL.framework/Versions/Current
in Terminal, and the framework was updated. If I run the GDAL 1.11 installer it still shows up as a failed installation, BUT QGIS recognizes 1.11 as the installed, so that's great.
(I just needed to install matplotlib in addition, and QGIS was installed successfully.)
It seems that the GDAL Complete framework was just updated 3 days ago, so it should be a temporary error until they realize the package is empty.

Mac OS Snow Leopard, IPython Notebook matplotlib backend mismatch with libpng

The other day I was trying to delve deeper into this question and provide some insights. Maybe with the additional insights it can finally be solved.
Things to note:
Installing a different Python version is not an option for me (I'd do it in a heartbeat) because I need to use the Gurobi linear programming solver.
matplotlib is compiled with libpng 1.5.14 and linked at runtime just fine. In the IPython console I can use it to plot png figures perfectly.
Because of the previous point I believe the error must occur with the backend used in the IPython Notebook which is also compiled with matplotlib.
I'm trying the whole thing with the source for matplotlib 1.3, if someone can make it work with a previous, not too old version I'd be happy, too.
So, when I try to plot something in the Notebook I get the normal text output from matplotlib put no figure. In the terminal where I started the notebook, I can see the following error:
libpng warning: Application built with libpng-1.2.41 but running with 1.5.14
Since I concluded earlier that the problem must lie in the backend, I checked what libraries are linked there:
otool -L /Library/Python/2.6/site-packages/matplotlib-1.3.0-py2.6-macosx-10.6-universal.egg/matplotlib/backends/_tkagg.so
The output on my system was:
/Library/Python/2.6/site-packages/matplotlib-1.3.0-py2.6-macosx-10.6-universal.egg/matplotlib/backends/_tkagg.so:
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
/System/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.7)
/System/Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.7)
So the likely offending candidates are Tcl and Tk. Then I ran:
find /System -name libpng\*
and indeed I find:
/System/Library/Tcl/8.4/Img1.4/libpngtcl1.2.24.dylib
/System/Library/Tcl/8.5/Img1.4/libpngtcl1.2.24.dylib
as well as Python shipping its own:
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/libpng.3.dylib
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/libpng.dylib
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/libpng12.0.dylib
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/libpng12.dylib
I went ahead and downloaded the source code for Tcl/Tk 8.6 and compiled them myself in the hope of them compiling against libpng but that wasn't the case. I still got the same error:
libpng warning: Application built with libpng-1.2.41 but running with 1.5.14
When I compile matplotlib it says that due to patches it ships its own libagg and I can't find which tkagg it is using, so maybe that's where things go wrong? Or is the Python 2.6 provided by the system compiled with Tk which is linked against that older libpng?
I guess I could try compiling matplotlib against the libpng version of Tcl/Tk 8.5 or against the one available in the Python framework and see if then both run on libpng version 1.2.41.
Does anyone know where in the backend this might occur and how to fix the compilation to use the right libpng version?
Have you solved the problem yet? I have a similar issue, and I solved it by temporarily renaming the folder containing the header files of libpng shipped with Python (in my case, it's X11) when building matplotlib. After installing matplotlib, rename the folder back.