Topics
Replies
depot051
20 Feb 2018, 15:00
Protocol buffer doesn't support Python properly, you have to modify it manually and install pure python protocol buffer implementation (because C++ scoping rules ruins Python) to get them work.
pip uninstall protobuf
pip install --no-binary protobuf protobuf
And compile those proto files seperately. I don't know why that's the case.
protoc --proto_path=ctrader/open-api-proto-lib --python_out=ctrader/proto_gen ctrader/open-api-proto-lib/OpenApiModelMessages.proto ctrader/open-api-proto-lib/OpenApiMessages.proto
protoc --proto_path=ctrader/open-api-proto-lib --python_out=ctrader/proto_gen ctrader/open-api-proto-lib/CommonModelMessages.proto ctrader/open-api-proto-lib/CommonMessages.proto
The last problem is how generated Python code import model modules isn't correct. Add relative path by hand to import code as belows
from . import ... as ...
That's how I get it work
@depot051
depot051
09 Mar 2018, 17:17
RE:
Any progress or roadmap for Open API v2.0 ?
Panagiotis Charalampous said:
@depot051