Reputation: 1964
System information:
Ubuntu 16.04, Anaconda 1.6.9, Python 3.6.4, libopencv 3.4.1, opencv 3.4.1, py-opencv 3.4.1.
Problem definition: I just upgraded my opencv
to 3.4
through anaconda and found could not import.
The import error is:
ImportError: anaconda3/lib/python3.6/site-packages/../../libopencv_dnn.so.3.4: undefined symbol: _ZNK6google8protobuf7Message25InitializationErrorStringB5cxx11Ev
Upvotes: 3
Views: 4839
Reputation: 1964
The following solution works for me, although not sure why and how.
conda install -c defaults libprotobuf protobuf
conda install -c menpo opencv3
Upvotes: 4
Reputation: 38253
Have you tried this answer from GitHub:
- Configure /usr/local/cuda/include/host_config.h as suggested. (remove the gcc 5 error from the CUDA header host_config.h)
sudo apt-get autoremove libprotobuf-dev protobuf-compiler
- then compile the protobuf-2.5.0 from src and install Please config the gcc when you compile protobuf ./configure --prefix=/usr/local/ CC=/usr/bin/gcc
Also (GitHub user groakat mentions):
for me this problem was caused because I had protobuf installed in anaconda. If you have protobuf installed in your anaconda environment, you have to remove all files by hand, as conda uninstall protobuf does not remove all the library files.
Upvotes: 0