[英]opencv import error (libopencv_dnn.so.3.4 undefined symbol)
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. 问题定义:我刚刚通过anaconda将opencv
升级到3.4
,发现无法导入。
The import error is: 导入错误是:
ImportError: anaconda3/lib/python3.6/site-packages/../../libopencv_dnn.so.3.4: undefined symbol: _ZNK6google8protobuf7Message25InitializationErrorStringB5cxx11Ev ImportError:anaconda3 / lib / python3.6 / site-packages /../../ libopencv_dnn.so.3.4:未定义的符号:_ZNK6google8protobuf7Message25InitializationErrorStringB5cxx11Ev
以下解决方案对我有用,尽管不确定原因和方式。
conda install -c defaults libprotobuf protobuf
conda install -c menpo opencv3
Have you tried this answer from GitHub : 您是否从GitHub尝试过此答案:
- Configure /usr/local/cuda/include/host_config.h as suggested. 根据建议配置/usr/local/cuda/include/host_config.h。 ( remove the gcc 5 error from the CUDA header host_config.h ) ( 从CUDA标头host_config.h中删除gcc 5错误 )
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 然后从src编译protobuf-2.5.0并安装编译protobuf时请配置gcc ./configure --prefix = / usr / local / CC = / usr / bin / gcc
Also (GitHub user groakat mentions): 另外(GitHub用户groakat提到):
for me this problem was caused because I had protobuf installed in anaconda. 对我来说,这个问题是由于在anaconda中安装了protobuf而引起的。 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. 如果您在anaconda环境中安装了protobuf,则必须手动删除所有文件,因为conda卸载protobuf不会删除所有库文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.