I've just installed Google protocol buffer on my snow leopard mac. When going into the python shell

import protobuf

produces an unknown module error. I'm using the python which came with snow leopard:

/usr/bin/python

Should I specify a PYTHON_PATH variable before installation and if so what should it be?

Thanks!

The module is not called protobuf, but google.protobuf. In the extracted source tarball, there's an examples directory. Run make python and check out the files add_person.py,list_people.py and addressbook_pb2.py to get you started. Hope this helps!

  • Thanks. That clarification really helped. Lesson learnt about following examples as well ;-) – user25594 Jan 21 '10 at 13:07

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.