Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Google's ProtoBuf (and a .proto file) to create a Python API Library

I have the .proto file used in the open-source Android API (http://code.google.com/p/android-market-api/), and am having some trouble compiling the file to generate the .py.

I'm trying to follow the instructions here, https://developers.google.com/protocol-buffers/docs/pythontutorial , and am on the steps that are under the header "Compiling Your Protocol Buffers".

I've downloaded the compiler, protoc.exe. The readme says "To install, simply place this binary somewhere in your PATH," which I'm not understanding. I'm messed around with it for a while now, but can't think of how to proceed.

I'm quite the novice programmer, so please tell me if something isn't clear, or if I'm having some sort of fundamental misunderstanding... about anything. I'm on Windows 7 by the way.

Thanks!

like image 448
r123454321 Avatar asked Oct 07 '22 16:10

r123454321


1 Answers

if protoc.exe is not in the same directory you're calling it from, you need to add it to your PATH environment variable to be accessible from the calling directory when you're in the shell. open up a command shell and execute:

set PATH=%PATH%c:\directory\to\proto\executable;

then change directories over to where your source code is and execute the compilation line as instructed from the google page.

like image 182
silijon Avatar answered Oct 12 '22 20:10

silijon