4
votes

From the last 2 days, I have been trying to install caffe on OSX 10.10

I was able to run all the installation commands successfully for caffe but when I tried to import caffe in ipython I got the exact same error: https://github.com/BVLC/caffe/issues/2092

So, as suggested in the thread, I tried to downgrade protobuf from 3.0.0 to 2.6.1. I was successfully able to install protoc and the new version does say 2.6.1

But now I not able to install protobuf python library. I am following the instructions mentioned here: https://github.com/google/protobuf/tree/v2.6.1/python I get the following error while running the command python setup.py google_test:

from google.protobuf import descriptor_pb2

File "/path/to/protobuf-2.6.1/python/google/protobuf/descriptor_pb2.py", line 21, in module>

80\x80\x80\x02\"}\n\x10\x45numValueOptions\x12\x19\n\ndeprecated\x18\x01 \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"{\n\x0eServiceOptions\x12\x19\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"z\n\rMethodOptions\x12\x19\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x9e\x02\n\x13UninterpretedOption\x12;\n\x04name\x18\x02 \x03(\x0b\x32-.google.protobuf.UninterpretedOption.NamePart\x12\x18\n\x10identifier_value\x18\x03 \x01(\t\x12\x1a\n\x12positive_int_value\x18\x04 \x01(\x04\x12\x1a\n\x12negative_int_value\x18\x05 \x01(\x03\x12\x14\n\x0c\x64ouble_value\x18\x06 \x01(\x01\x12\x14\n\x0cstring_value\x18\x07 \x01(\x0c\x12\x17\n\x0f\x61ggregate_value\x18\x08 \x01(\t\x1a\x33\n\x08NamePart\x12\x11\n\tname_part\x18\x01 \x02(\t\x12\x14\n\x0cis_extension\x18\x02 \x02(\x08\"\xb1\x01\n\x0eSourceCodeInfo\x12:\n\x08location\x18\x01 \x03(\x0b\x32(.google.protobuf.SourceCodeInfo.Location\x1a\x63\n\x08Location\x12\x10\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01\x12\x10\n\x04span\x18\x02 \x03(\x05\x42\x02\x10\x01\x12\x18\n\x10leading_comments\x18\x03 \x01(\t\x12\x19\n\x11trailing_comments\x18\x04 \x01(\tB)\n\x13\x63om.google.protobufB\x10\x44\x65scriptorProtosH\x01')

TypeError: init() got an unexpected keyword argument 'syntax'

There isn't much on Google. Please help.

1

1 Answers

0
votes

I'm using brew and pip and things work out fine, try a fresh install for protobuf 2.6.0 as follows :

# First, uninstall protobuf
# Then let's install protobuf 2.6.0 for Mac
brew install homebrew/versions/protobuf260
# And install the corresponding python library version
pip install protobuf==2.6.0

I used 2.6.0 here because 2.6.1 seems not yet available on brew.