Error installing PyQt5 - qt

I am trying to install PyQt 5 on my Mac osx 10.9, so I did the following:
I downloaded SIP and installed it.
I downloaded QT 5.3.2 and installed it by its installer, so now its installed in
/Users/username/Qt
so i have added it to the path by doing this
PATH=/Users/gollahalli/Qt/5.3/clang_64/bin:$PATH
and
export PATH
Next i tried installing PyQt by doing the following
python3 configure.py --qmake /Users/username/Desktop/PyQt
but i still get this error
Error: PyQt5 requires Qt v5.0 or later. You seem to be using v3. Use the --qmake flag to specify the correct version of quake.
Any idea what went wrong?

You could point --qmake directly to the binary rather than the toplevel directory. In my case this was:
python3 configure.py --qmake ~/Qt5.4.1/5.4/clang_64/bin/qmake

Related

How to Install qt4 on macOS with homebrew?

I need to install the qt4 C++ framework for one of my classes. I tried using the regular installer from the download archives page for both qt4.7 and qt4.8, however I get the warning:
"Installing this package may damage your system, and the installation may fail."
So I looked into installing it via homebrew and initially tried:
brew tap cartr/qt4
brew tap-pin cartr/qt4
brew install qt#4
However, that gives me this error:
Error: Calling brew tap-pin user/tap is disabled! Use fully-scoped user/tap/formula naming instead.
I looked online for a solution and was able to install it by omitting the brew tap-pin cartr/qt4 command:
brew tap cartr/qt4
brew install qt#4
I then tried to create a sample qt program in the CLion IDE and checked the version I was using, and it said I was using qt5 (from the python anaconda distribution). So my question is, can I install both qt4 and qt5 on my system simultaneously? How do I select which version to use?
You can install both simultaneously. You can select which to use.
When you install qt (meaning qt5) using homebrew, it produces a "Caveats" message that answers your question.
It says will need to set certain environment variables yourself.
It says that, in only those shell sessions where you set those environment variables, qt (meaning qt5) will be available.
It says, if you want qt always available, then you can simply put those settings in your dot files.
If you install qt#4 and set those same variables to point to qt#4, then qt#4 will be available instead.
You can view the same "Caveats" message again using brew info qt. Here is the whole message:
qt is keg-only, which means it was not symlinked into /usr/local,
because Qt 5 has CMake issues when linked.
If you need to have qt first in your PATH run:
echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.zshrc
For compilers to find qt you may need to set:
export LDFLAGS="-L/usr/local/opt/qt/lib"
export CPPFLAGS="-I/usr/local/opt/qt/include"
For pkg-config to find qt you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig"
The same commands with qt#4 made qt#4 available for me:
export PATH="/usr/local/opt/qt#4/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/qt#4/lib"
export CPPFLAGS="-I/usr/local/opt/qt#4/include"
export PKG_CONFIG_PATH="/usr/local/opt/qt#4/lib/pkgconfig"
By the way, I installed qt#4 using the user/tap/formula syntax: brew install cartr/qt4/qt#4

module "QtMultimedia" is not installed

I've installed Qt and Qtcreator on a Raspberry Pi 3 using the normal apt-get install method. Everything seems to work fine except when I try to build the declarative-camera example or other multimedia examples I get an error saying module "QtMultimedia" is not installed. Then the empty white application window pops up.
I've tried installing and reinstalling all the required packages such as libqt5multimedia5, qtmultimedia5-dev, etc and it just says they are installed with newest version.
Has anyone had success with getting qt multimedia working on raspberry pi?
Edit:
I tried using the suggested solution of:
sudo apt-get install qtdeclarative5-qtmultimedia-plugin
That gives me an error of:
E: Unable to locate package qtdeclarative5-qtmultimedia-plugin
This seemed to work run the command below:
sudo apt-get install libqt5multimedia5-plugins qml-module-qtmultimedia
I was missing libqt5multimedia5-plugins
Open Qt Maintenance Tool (It is already installed on your pc when you downloaded Qt)
Login to your Qt account and hit next
Select Add or Remove Components, next
Go to Qt -> (The Qt version you installed) -> Additional Libraries and select Qt Multimedia like this
Hit next to install it

qtwebengine qmake error: unkown module: webchannel

I am trying to get qt webengine running on my laptop for the first time, but can't seem to build it. I am following the instructions from here:
https://wiki.qt.io/QtWebEngineHowToTry
On the last few steps, I had to run "qmake -r" on the qtwebengine directory. This is the output:
SSL............................... Using system NSS
ICU............................... Using internal copy (Default, force system ICU with WEBENGINE_CONFIG += use_system_icu)
FFMPEG............................ Using internal copy (Default, force system FFMPEG with WEBENGINE_CONFIG += use_system_ffmpeg)
Proprietary codecs (H264, MP3).... Not enabled (Default, enable with WEBENGINE_CONFIG += use_proprietary_codecs)
Reading /home/kevin/workspace/qtwebengine/src/src.pro
Reading /home/kevin/workspace/qtwebengine/src/core/core.pro
Reading /home/kevin/workspace/qtwebengine/src/core/core_gyp_generator.pro
Project ERROR: Unknown module(s) in QT: webchannel
This error happened right after I installed WebKitGtk+ from here (http://trac.webkit.org/wiki/BuildingGtk) and ran "Tools/gtk/install-dependencies" and "Tools/Scripts/update-webkitgtk-libs". Before I installed WebKitGtk+, qmake would terminate at a later point.
(I installed WebKitGtk+ because, previously, running "qmake -r" on the qtwebengine directly resulted in an "unmet dependency: harfbuzz" error that I tried to fix on my own via google, and the WebKitGtk+ page was the only lead I could find that would supposedly fix that issue... big mistake!).
I am running on a (mostly freshly reformatted) Ubuntu 15.04 laptop. I installed qt5 via apt-get install, but apparently I have both qt4 and qt5 plugins installed, as well as qtchooser (I'm guessing from the WebKitGtk+ installation scripts).
Here is the output of "qmake --version":
QMake version 3.0
Using Qt version 5.4.1 in /usr/lib/x86_64-linux-gnu
Any help would be greatly appreciated, as I'm excited to try out qt webengine!
In case anyone else has the same problem, I fixed it by installing qt 5.5.0 from here http://download.qt.io/official_releases/qt/, and using the associated qmake binary from that installation. I guess installing qt from 'sudo apt-get install' still has some issues that won't work with qtwebengine.

PyQT5 error: could not find or load Qt platform plugin xcb

Up until Anaconda3 (which contains Python 3.4) was re-installed on my RedHat 6.5 workstation, I have been able to develop Python apps that use PyQT5.
Post re-install of Anaconda I receive an error message:
....could not find or load Qt platform plugin xcb
The only difference between Anaconda installs is the folder name: /usr/local/ananaconda3 vs /usr/local/anaconda_py3
I checked libqxcb.so has no missing dependencies.
I rebuilt PyQT5.
I tried explicitly adding location of site-packages of PyQT5:
import site
site.addsitedir("...path.../python3.4")
Any other suggestions?
How does re-installing Python impact the use of PyQT5?
This is an error caused by having two different versions of Qt under the same installation/environment.
Check the packages installed and their versions in your environment (if for some reason you're not working in a virtual environment, you can skip the first line):
source activate yourenvname
conda list
If you see pyqt and qt both with version 4.X.X then remove them (assuming you want to work in Qt v5):
conda remove qt
conda remove pyqt
I had an issue that seems to match what happened here.
But in my case the solution was to "sudo rm -rf user/anaconda3" and reinstall it with "bash anaconda....sh", because I had previously installed it using sudo ("sudo bash anaconda....sh")

Ubuntu 13.04 -> opencv and qt installation

I'm trying to install opencv (2.4.5) with Qt in my fresh Ubuntu 13.04.
I've downloaded opencv, executed:
ccmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ../opencv-2.4.5
../opencv-2.4.5 is the folder of the opencv source
and in ccmake I changed the WITH_QT variable to YES
than make and sudo make install
But now if in kdevelop I try to execute my test code (I only call addText(...) over an image). I get the following error:
OpenCV Error: The function/feature is not implemented (The library is compiled without QT support) in fontQt, file...
What I'm doing wrong?
Thanks in advance for any suggestion
edit: I had both qt4 and qt5 due to the QtCreator installation.
For a fast solution I removed qt5 and qtcreator and reinstalled opencv.
Now it works, but is there a cmakelist for opecv that enable to use qt5?
Have you looked at This Using CMake with Qt 5
I'm not sure if I should answer my question, anyway:
If you look at the github repository of OpenCV, 4 days ago the CMakeList.txt has been updated to support Qt5.
So the solution is to clone the project and install it from source.
I tested it and it works.

Resources