I use Fedora release 20 (Heisenbug), I need QT version 5.3.2 and QMake version 3.0
so, I try yum install qt-devel
and rpm -qa | grep qt
qt-x11-4.8.6-30.fc20.x86_64
qt-settings-20-18.fc20.noarch
qt5-qtbase-gui-5.2.0-4.fc20.x86_64
qt-devel-4.8.6-30.fc20.x86_64
qt5-qtbase-5.2.0-4.fc20.x86_64
qt-4.8.6-30.fc20.x86_64
How to install qt version 5.3.2 and qmake version3.0?
I think the best way to do it is to go to the QT website and download the package from there. But why do you need an older version? There is a version for linux 5.7.0. Just download the version, probably 5.7.0 for 64bit linux, and then run:
chmod +x qt-opensource-linux-x64-5.7.0.run
and then ./qt-opensource-linux-x64-5.7.0.run
Keep in mind it needs to be installed as with root permissions so either use sudo or su. Change the working directory after that.
Now if you want specifically this version, you must find the executables and install them from there, i dont know if fedora provides something like that from their package manager.
My OS is Kubuntu 14.04.
I installed Qt5 via apt-get install libqt5-dev
How can i upgrade my Qt to the new Version of Qt(5.4)? I could install it manually but then the files in usr/include etc. are not updated and CMake is always searching there first, therefore not the newest Version will be picked. Is there a way to do something like make install to upgrade the existing Qt Version that will be used as default?
How to install gcc version 4.8 on centos or scientific linux operating systems which require yum for installing.
I tried to download gcc from https://ftp.gnu.org/gnu/gcc/gcc-4.8.2/ and then ran ./configure and then make. After running make it gives me the error: configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
Is there some way by which I may install gcc version 4.8 on linux using yum install
I tried:
1). I tried with yum --enablerepo=testing-2-devtools-6 install devtoolset-2-gcc devtoolset-2-gcc-c++ it gives me repository not found
2). yum group install "Development Tools". It gives me Package gcc-4.4.7-11.el6.x86_64 already installed and latest version
3). building it from scratch, you'll have to do ./contrib/download_prerequisites first to get MPFR, GMP and MPC in the GCC source tree, then make a separate directory and run /path/to/gcc/source/configure.
It gives:
configure: error: building out of tree but /home/Softwares/gcc-4.8.2
contains host-x86_64-unknown-linux-gnu
https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/3/html/3.0_Release_Notes/DTS3.0_Release.html#Features
Install the Red Hat Developer Toolset 3.0 (or 2.X) in a way similar to what is described here. (Basically you use a repo someone else built for CentOS).
Google says to try
yum group install "Development Tools"
check out: http://www.cyberciti.biz/faq/centos-rhel-7-redhat-linux-install-gcc-compiler-development-tools/
I had installed OpenCV following these steps. After trying to compile one example, I got this error:
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvNamedWindow, file /home/nick/.Apps/opencv/modules/highgui/src/window.cpp, line 516
terminate called after throwing an instance of 'cv::Exception'
what(): /home/nick/.Apps/opencv/modules/highgui/src/window.cpp:516: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvNamedWindow
CMakeLists.txt
cmake_minimum_required(VERSION 2.8.4)
project(threadTest)
find_package( OpenCV REQUIRED )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -pthread")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "/home/nick/ClionProjects/threadTest")
set(SOURCE_FILES main.cpp)
add_executable(threadTest ${SOURCE_FILES})
target_link_libraries( threadTest ${OpenCV_LIBS} )
How can I solve it?
First check whether libgtk2.0-dev is installed properly. If you have installed aptitude package manager, run the following:
sudo aptitude search libgtk2.0-dev
It should return like this:
i libgtk2.0-dev - development files for the GTK+ library
p libgtk2.0-dev:i386 - development files for the GTK+ library
You need to build the files once again. Locate your OpenCV folder. Create a new folder and name it Release. Enter into this folder. For example,
cd /home/user_name/OpenCv
mkdir Release
cd Release
Now build using CMake with following command:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_GTK=ON -D WITH_OPENGL=ON ..
Remember to put WITH_GTK=ON during CMake.
After this step, enter the command,
make
sudo make install
This should resolve your problem. If you have broken dependencies for libgtk2.0-dev, then install a fresh copy of libgtk2.0-dev using aptitude.
sudo aptitude install libgtk2.0-dev
If you installed OpenCV using the opencv-python pip package, be aware of the following note, taken from opencv-python:
IMPORTANT NOTE
macOS and Linux wheels have currently some limitations:
video related functionality is not supported (not compiled with FFmpeg)
for example cv2.imshow() will not work (not compiled with GTK+ 2.x or Carbon support)
Also note that to install from another source, first you must remove the opencv-python package.
To install OpenCV in Ubuntu, I followed this guide, and it worked perfectly fine: Ubuntu 16.04: How to install OpenCV
In order to improve Nic Szer's answer I want to explain how to fix this error on macOS in three simple steps.
Remove installed OpenCV version to avoid messing up later
pip3 uninstall opencv-python
Lower your Python version to 3.5 (the current version, 3.6, has problems with Conda which we will use to install OpenCV)
conda install python=3.5
Finally, use Conda to install a working version of OpenCV
conda install -c menpo opencv3
And then voilà: OpenCV will start working on your macOS (macOS v10.12.4 (Sierra)).
For Windows, just uninstall the OpenCV package:
pip uninstall opencv-python
And reinstall:
pip install opencv-python
In case what is mentioned in previous answers doesn't work, try:
pip install opencv-python
for Python 2, or
pip3 install opencv-python
for Python 3.
For me (Arch Linux, Anaconda with Python 3.6), installing from the suggested channels menpo or loopbio did not change anything. My solution was to
install pkg-config (sudo pacman -Syu pkg-config),
remove opencv from the environment (conda remove opencv) and
re-install opencv from the conda-forge channel (conda install -c conda-forge opencv)
conda list now returns opencv 3.3.0 py36_blas_openblas_203 [blas_openblas] conda-forgeand all windows launched using cv2 are working fine.
I have had to deal with this issue a couple of times, and this is what has worked consistently thus far:
conda remove opencv
conda install -c menpo opencv
pip install --upgrade pip
pip install opencv-contrib-python
I have the solved using Anaconda 3 installing on Ubuntu 16.04 (Xenial Xerus).
I have used the PyCharm editor for my Python code.
I am using the Python 3.6 version.
I solved the issue using these processes.
IDEA: we need to install the package opencv-contrib-python package from PyCharm.
After installing OpenCV using vcpkg on Ubuntu, there is a known issue with vcpkg where you'll end up with the exact same error message as the top of this post with no access to highgui:
OpenCV(4.3.0) Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support.
If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvNamedWindow,
file .../vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/highgui/src/window.cpp, line 634
Caught exception: OpenCV(4.3.0) .../vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/highgui/src/window.cpp:634:
error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support.
If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvNamedWindow'
The problem is vcpkg passes in the build option -DWITH_GTK=OFF when building OpenCV. The open issue: https://github.com/microsoft/vcpkg/issues/12621
The workaround is the following:
edit the file vcpkg/ports/opencv4/portfile.cmake
find the line that says -DWITH_GTK=OFF and change it to say -DWITH_GTK=ON
run ./vcpkg remove opencv4
run sudo apt-get install libgtk2.0-dev pkg-config
reinstall OpenCV with ./vcpkg install opencv4 or whichever vcpkg command you used
I have Ubuntu 16.04 LTS (Xenial Xerus) environment with GTK 3 preinstalled.
I got the same error for Caffe build (master branch),
Try the following steps, may be it should work for you.
sudo apt-get install libgtk-3-dev
cmake .. (WITH_GTK=ON and other settings),
make
And bingo, the error was gone... in my Python Caffe code
Please note:
The CMake configuration should reflect GTK+ 3.x instead of GTK+ 2.x:
GUI:
-- QT: NO
-- GTK+ 3.x: YES (ver 3.18.9)
-- GThread : YES (ver 2.48.2)
-- GtkGlExt: NO
-- OpenGL support: NO
-- VTK support: NO
I have fixed my issue using this,try it
pip install opencv-python-headless==4.5.3.56
pip install opencv-contrib-python==4.5.3.56
pip install opencv-python==4.5.3.56
I had the same problem, and fixed it by simply reinstalling opencv.
There is no need to uninstall it first.
My issue was solved after installing opencv-contrib-python:
pip install opencv-contrib-python
I tried several of the previous answers the one that worked for me in ubuntu is mentioned in the following steps:
Firstly, remove the current opencv package that is installed in your system by typing in the following command in the terminal conda remove opencv.
If your Python version is 3.6 or above then change it into the stable version which can be done by typing in conda install python=3.5.
Later on, install the opencv package again by giving the following input in terminal conda install -c menpo opencv3
I had the same issue and it has been resolved after uninstalling opencv-python and doing a fresh install.
pip uninstall opencv-python
pip install opencv-python
try this. It worked for me
sudo apt-get install cmake cmake-curses-gui libgtk2.0-dev
pip install opencv-contrib-python
reinstalling and installing with the above command solved my issue but just after closing all instances of pyhton and anaconda because apparently a cache version of the library was being kept in my system.
Hence, uninstall opencv (try with pip and conda), close the IDE and reboot it, check if you can import opencv. If you still can import it, try to run the code:
help(cv2)
and check where the files are stored and delete that folder.
Repeat the process untill you are sure it is uninstalled so you can reinstall opencv full package (option 2 - see https://pypi.org/project/opencv-python/ )
I had the same issue and it has been resolved after uninstalling opencv-python version 4 and then installing the OpenCV version 3.
pip install opencv-python==3.4.9.33
I have fixed this issue by replacing
cvDestroyWindow("showImage");
by
cvDestroyWindow("ShowImage");
Due to legacy issues I have to install the gcc/g++ version 4.4.7 in my current Ubuntu-gnome 14.04 32 bit virtual machine.
The default update via apt-get install is the 4.8.2 which is a "no go" work for this project.
I've removed it (apt-get remove) . The downloaded and tried to install the 4.4.7 source but it requires to many dependencies.
Via apt-get install I've tried doing:
sudo apt-get install gcc-4.4
The download/install is quite fast and when checkign gcc version it give indication that no gcc is installed to run the
sudo apt-get install gcc
If I do this I'll get the 4.8version.
All above also applies to g++.
I compiled the code with the following flag which solved the problem:
g++-4.4.7
It compiles for a specific version. (in this case 4.4.7)
To install a specific version use sudo apt-get install package=version. Or use synaptic package manager which allows you to install specific versions.