>>> import caffeTraceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/user/bin/caffe/python/caffe/__init__.py", line 1, in <module> from .pycaffe import Net, SGDSolver File "/home/user/bin/caffe/python/caffe/pycaffe.py", line 14, in <module> import caffe.io File "/home/user/bin/caffe/python/caffe/io.py", line 8, in <module> from caffe.proto import caffe_pb2 File "/home/user/bin/caffe/python/caffe/proto/caffe_pb2.py", line 4, in <module> from google.protobuf.internal import enum_type_wrapperImportError: No module named google.protobuf.internal
Note that the PYTHONPATH is properly configured. And I have the protobuf (see below):
/usr/include/google/protobuf/usr/include/google/protobuf/descriptor.h/usr/include/google/protobuf/descriptor.pb.h/usr/include/google/protobuf/descriptor.proto.../usr/include/google/protobuf/stubs/platform_macros.h/usr/include/google/protobuf/stubs/template_util.h/usr/include/google/protobuf/stubs/type_traits.h
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include
[xxw345@gpu002t caffe]$ pythonPython 2.7.12 |Anaconda custom (64-bit)| (default, Jul 2 2016, 17:42:40)[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2Type "help", "copyright", "credits" or "license" for more information.Anaconda is brought to you by Continuum Analytics.Please check out: http://continuum.io/thanks and https://anaconda.org>>> import google.protobuf
>>> import caffeTraceback (most recent call last):File "<stdin>", line 1, in <module>
File "/home/xxw345/caffe/python/caffe/__init__.py", line 1, in <module>from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolverFile "/home/xxw345/caffe/python/caffe/pycaffe.py", line 15, in <module>import caffe.ioFile "/home/xxw345/caffe/python/caffe/io.py", line 8, in <module>from caffe.proto import caffe_pb2File "/home/xxw345/caffe/python/caffe/proto/caffe_pb2.py", line 6, in <module>from google.protobuf.internal import enum_type_wrapperImportError: No module named internal
[xxw345@gpu002t caffe]$ pythonPython 2.7.12 |Anaconda custom (64-bit)| (default, Jul 2 2016, 17:42:40)[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2Type "help", "copyright", "credits" or "license" for more information.Anaconda is brought to you by Continuum Analytics.Please check out: http://continuum.io/thanks and https://anaconda.org>>> import google.protobuf>>> print google.protobuf.__file__/home/xxw345/.local/lib/python2.7/site-packages/google/protobuf/__init__.pyc
[xxw345@gpu002t caffe]$ which protoc~/.usr/local/bin/protoc[xxw345@gpu002t caffe]$ ~/anaconda2/bin/pip install protobufRequirement already satisfied (use --upgrade to upgrade): protobuf in /home/xxw345/.local/lib/python2.7/site-packagesRequirement already satisfied (use --upgrade to upgrade): six>=1.9 in /home/xxw345/anaconda2/lib/python2.7/site-packages (from protobuf)Requirement already satisfied (use --upgrade to upgrade): setuptools in /home/xxw345/anaconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg (from protobuf)
[xxw345@gpu002t caffe]$ ~/anaconda2/bin/pip uninstall protobufUninstalling protobuf-3.0.0:/home/xxw345/.local/lib/python2.7/site-packages/protobuf-3.0.0-py2.7-nspkg.pth/home/xxw345/.local/lib/python2.7/site-packages/protobuf-3.0.0.dist-info/DESCRIPTION.rst/home/xxw345/.local/lib/python2.7/site-packages/protobuf-3.0.0.dist-info/METADATA/home/xxw345/.local/lib/python2.7/site-packages/protobuf-3.0.0.dist-info/RECORD/home/xxw345/.local/lib/python2.7/site-packages/protobuf-3.0.0.dist-info/WHEEL/home/xxw345/.local/lib/python2.7/site-packages/protobuf-3.0.0.dist-info/metadata.json/home/xxw345/.local/lib/python2.7/site-packages/protobuf-3.0.0.dist-info/namespace_packages.txt/home/xxw345/.local/lib/python2.7/site-packages/protobuf-3.0.0.dist-info/top_level.txtProceed (y/n)? ySuccessfully uninstalled protobuf-3.0.0
[xxw345@gpu002t caffe]$ ~/anaconda2/bin/pip install protobufCollecting protobufUsing cached protobuf-3.0.0-py2.py3-none-any.whlRequirement already satisfied (use --upgrade to upgrade): six>=1.9 in /home/xxw345/anaconda2/lib/python2.7/site-packages (from protobuf)Requirement already satisfied (use --upgrade to upgrade): setuptools in /home/xxw345/anaconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg (from protobuf)Installing collected packages: protobufSuccessfully installed protobuf-3.0.0
[xxw345@gpu002t caffe]$ ~/anaconda2/bin/pip install protobufRequirement already satisfied (use --upgrade to upgrade): protobuf in /home/xxw345/anaconda2/lib/python2.7/site-packagesRequirement already satisfied (use --upgrade to upgrade): six>=1.9 in /home/xxw345/anaconda2/lib/python2.7/site-packages (from protobuf)Requirement already satisfied (use --upgrade to upgrade): setuptools in /home/xxw345/anaconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg (from protobuf)
[xxw345@gpu002t caffe]$ pythonPython 2.7.12 |Anaconda custom (64-bit)| (default, Jul 2 2016, 17:42:40)[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2Type "help", "copyright", "credits" or "license" for more information.Anaconda is brought to you by Continuum Analytics.Please check out: http://continuum.io/thanks and https://anaconda.org>>> import caffe>>>