OpenCV python GTK implementation error - python-3.x

I was trying to build opencv 3.2.0 from source for python3.5 in my ubuntu 16.04. When I cmake the targets it showed GTK+ 2.X yes. But after everything is completed successfully I am still getting error for cv2.imshow saying "function not implemented. Please build with GTK+ 2.X or carbon support".
I tried possible solution with QT5 as well. Nothing did work. If possible kindly help.

Related

How to solve "plugin failed code 127" compiling with nanopb

I am trying to compile a c++ code in an conan enviroment, here are details:
Ubuntu 18.04 WSL x86-64
Windowns 10 x64
python 3.7.5
protoc 3.19.4
The project is located at /mnt/c/project
The build directory is located at /mnt/c/build
The build occurs without any errors but when I try to compile with "ninja" it throws an error related to protoc-gen-nanopb, as you can see attached image.
I tried to install a new protobuf from its c++ source, i added the LD_LIBRARY_PATH that was missing, and I have also tried to clean everything and erase all the files and build again. Everything seems to fail. I believe it's related to compatibility between protobuf and my python version, but I am not sure.
Could someone help me understand how to solve it? I am new to ubuntu and stackoverflow and i am sorry if some information is missing. In this case, just ask.
Error 127

Boost.Python Quickstart Failing

I am trying to run the quickstart example found here
I am able to follow the instructions all the way through 3.1.4 where bjam is invoked but the tests all fail despite that is IS successfully finding python.
I am on Ubuntu 16.04
boost version 1.66.0
Python 3.5
gcc 5.4.0
bjam 2014.03
Any hints as to what the problem is would be greatly appreciated!
Update: #sehe was correct. It was using python2.7 instead of 3.5.

Protobuf for Python and protoc versions match still assertion fails

I am getting this error:
./google/protobuf/generated_message_util.h:86: const string&
google::protobuf::internal::GetEmptyStringAlreadyInited(): Assertion
`empty_string_ != __null' failed.
I have been trying to fix this all day long.
So the flow in my project goes like this:
I have a C++ project that I compile using CMake on Ubuntu 16.10. After some processing I want to send the data to a Python script that uses Keras for machine learning.
Now both of these scripts work perfectly independently. I wanted to send the data directly to the Python script. So I have embedded Python in C++ by referring this link
This is again working for a Python script that does not import keras.
Now when I import keras in this Python script, I get the above error, though both of them work properly independetly.
First I had got an error for the mismatch of libprotobuf and protoc versions which looked like:
Using TensorFlow backend.
[libprotobuf FATAL google/protobuf/stubs/common.cc:67] This program requires version 3.5.0 of the Protocol Buffer runtime library,
but the installed version is 3.0.0. Please update your library. If
you compiled the program yourself, make sure that your headers are
from the same version of Protocol Buffers as your link-time library.
(Version verification failed in "google/protobuf/descriptor.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): This program requires version 3.5.0 of the Protocol Buffer runtime library, but the installed version is 3.0.0. Please
update your library. If you compiled the program yourself, make sure
that your headers are from the same version of Protocol Buffers as
your link-time library. (Version verification failed in
"google/protobuf/descriptor.pb.cc".)
Aborted (core dumped)
I had installed protoc using apt-get (latest available on apt-get is 3.0.0) as I found out on one of the answers that you need not have protoc 3.5.0 for it to work. pip3 install protobuf installs protobuf 3.5.0 which resulted in the mismatch error message.
So I uninstalled this Python protobuf version and installed the older version using pip3 install protobuf==3.0.0. This removed the mismatch error message.
But now I am getting the aforementioned error message. I have also figured out that the error message is occuring due to Tensorflow dependency of Keras
How do I fix this?
Please help

Anaconda Python for Gurobi 6.0.4 installation _Py_FalseStruct error

In order to run an optimization problem we set up Gurobi 6.0.4 together with
Anaconda (Version 2.2.0) Python (Python 2.7.9.) on
Linux CentOS release 6.6 (Final) with the 2.6.32-504.16.2.el6.x86_64 Kernel
Following the installation guidelines of Gurobi (listed here: http://www.gurobi.com/documentation/6.0/quickstart_linux.pdf)
everything worked out in the first step. Gurobi was installed, could obtain a license. Also the PATH variables have been set (in the .bashrc) according to the manual, with a little extension for the referal to anaconda python (and not the other local Versions of python (being 2.7 and 3.4):
export GUROBI_HOME="/opt/gurobi604/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin:${PATH}:opt/anaconda/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
Following the procedure we executed: python2.7 setup.py install in the respective directory /opt/gurobi604/linux64. After this usually you could run the import gurobipy command in the python interpreter wihtout errors. For older Versions of Gurobi (as 5.6.3) this works out very well.
For 6.0.4 though we constantly receive the error:
ImportError: /opt/anaconda/lib/python2.7/site-packages/gurobipy/gurobipy.so: undefined symbol: _Py_FalseStruct
This is very reproducible, no matter if we put anaconda also in the global path, and check the bash for any overwriting of the environment variables, which is not the case.
On Windows 8 the Gurobi 6.0.4 and Anaconda Python 2.2.0 work together without any problems.
Also applying hints from here: Python Module Error on Linux did not work out.
Did anyone else experience these problems with this tooling combination? thx.
The error message indicates that you use the Python module for version 3.4 in your Python 2.7 package directory. This can happen if you do not clean your Python module build directory between builds. Please try the following:
Completely remove the 2.7 package from your Python 2.7 installation (e.g. remove /opt/anaconda/lib/python2.7/site-packages/gurobipy)
Completely remove the Python module build directory from your Gurobi installation (e.g. /opt/gurobi604/linux64/build)
Re-run the build process for the Python 2.7 module (e.g. run "python2 setup.py install" in /opt/gurobi604/linux64)
Please note that CentOS is currently a non-supported platform for Gurobi.
Thank you for the hint, I think we tried that, but did not finish the procedure in this way. We tried to clean the system but in that particular case still hat both python Versions (due to other applications that use 3.4) on the machine. Our solution in this case was just to reinstall everything clean on a Ubuntu 14.04 VM. Since then no further problems occured. (I know not the cleanest solution.)
We had some similar issues when we updated to Gurobi 6.5, but that could be solved when corrctly addressing the usual path issues.
Thank you in any case for the reply, I think this really will help us with the next, then clean deployment :-)

Any tips on compiling PyQt for Centos 5.5?

I have installed a bunch of qt packages - qt, qt-devel, qt4, qt4-devel, sip but can't get latest PyQt4 to compile.
I've pointed the configure script at my qt4lib as such
python configure.py -q /usr/lib64/qt4/bin/qmake --verbose
but getting errors like
DBus v1 does not seem to be installed.
cfgtest_QtHelp.cpp:1:25: error: qhelpengine.h: No such file or directory
sip: /mnt/hgfs/rnp_repos/PyQt-x11-gpl-4.8.1/sip/QtCore/qabstractitemmodel.sip:156: syntax error
Error: Unable to create the C++ code.
EDIT: Found out that SIP v4.11.2 is required for PyQt 4.8 but still can't make without errors. At least python configure.py finishes now.
Any tips?
Grab the PyQt4 SRPM from Fedora and rebuild using mock. You may need to look a few versions back for one that will compile against the version of Qt 4 in CentOS.
I've just successfully compiled PyQt 4.8 on Centos 5.5. I went down the route of building Qt4 from source - using qt-everywhere-opensource-src-4.7.1.tar.gz from Nokia.
Had to obtain various *-devel packages before Qt's ./configure would complete - see http://doc.qt.nokia.com/4.7/requirements-x11.html (don't worry about the version numbers being slightly lower than required).
Also I used Python 2.6 from the EPEL 5 repository (python26-devel). Just remember when building PyQt to run python26 configure.py (and not the default Python). I don't know if this will improve your mileage in building PyQt but we're porting an application from Windows which was already using 2.6 so this route was necessary for me.
Not going to post my entire .bash_history here (much trial and error!) but if you're trying this and get stuck please ask a question.

Resources