Can't get Google Protocol Buffer to compile
I am following the google python tutorial for the protocol buffer, I have been able to successfully do everything up until the compiler.
The tutorial says the following:
Now run the compiler, specifying the source directory (where your application's source code lives – the current directory is used if you don't provide a value), the destination directory (where you want the generated code to go; often the same as $SRC_DIR), and the path to your .proto. In this case, you...:
protoc -I=$SRC_DIR --python_out=$DST_DIR $SRC_DIR/addressbook.proto
Say I have the addressbook.proto file located on my desktop and the desktop is also where I want the generated code to go, what should the above terminal command then look like?
Assuming that you are working under linux, you could set the $SRC_DIR variable like this (note that I dropped the DST_DIR):
SRC_DIR="/home/USERNAME/Desktop" protoc -I=$SRC_DIR --python_out=$SRC_DIR $SRC_DIR/addressbook.proto
Or you could replace every $SRC_DIR and $DST_DIR with "/home/USERNAME/Desktop" (this will work on windows too if you instead use the path to your Desktop..)
In the future, if you don't want to compile Python proto classes yourself, you might consider the gtfs-realtime-bindings PyPI package, which provides pre-generated Pythong language bindings for GTFS-realtime. More details at:
(Full disclosure: I maintain these packages)