n@rjn-Oryx-Pro:~$ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import tensorflow
[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.4.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. 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 "external/protobuf_archive/src/google/protobuf/any.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): This program requires version 3.4.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. 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 "external/protobuf_archive/src/google/protobuf/any.pb.cc".)
Aborted (core dumped)
笔记:
rjn@rjn-Oryx-Pro:~$ pip2 show protobuf
Name: protobuf
Version: 3.5.2.post1
Summary: Protocol Buffers
Home-page: https://developers.google.com/protocol-buffers/
Author: [email protected]
Author-email: [email protected]
License: 3-Clause BSD License
Location: /usr/local/lib/python2.7/dist-packages
Requires: setuptools, six
Required-by: tensorflow, tensorflow-tensorboard, tensorflow-gpu
笔记:
sudo find .. / -name libprotobuf*
/usr/lib/x86_64-linux-gnu/libprotobuf.so.9
/usr/lib/x86_64-linux-gnu/libprotobuf.so.9.0.1
/usr/lib/paraview/libprotobuf.so
笔记:
我已按照 protobuf 网站上的所有说明手动安装 protobuf。按照指示复制到 /usr/local,但这并不能解决问题。
我也尝试从源代码进行编译,但检查失败并出现同样的错误。
make check
[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.5.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. 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/any.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 2.6.1. 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/any.pb.cc".)
我尝试使用 pip 和 apt-get 卸载 tensorflow 和 protobuf 然后重新安装,但仍然出现同样的错误。
我之前没有见过这个错误,现在似乎很多人都遇到了这个错误,但似乎没有任何解决方案有效。
在我的系统中扫描 protobuf 时显示:我不想删除它,因为我担心会破坏 Ubuntu。我的版本是 Ubuntu 16.04
/usr/lib/x86_64-linux-gnu/libprotobuf.so.9
/usr/lib/x86_64-linux-gnu/libprotobuf.so.9.0.1
/usr/lib/paraview/libprotobuf.so
答案1
我刚刚遇到了同样的问题:
原来是LD_PRELOAD
包含/usr/lib/x86_64-linux-gnu/libprotobuf.so.9
混淆了 Python 的,在我的 中删除它后.bashrc
,问题就解决了。