Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在.proto文件中定义任何.proto_Python_Python 3.x_Protocol Buffers - Fatal编程技术网

Python 在.proto文件中定义任何.proto

Python 在.proto文件中定义任何.proto,python,python-3.x,protocol-buffers,Python,Python 3.x,Protocol Buffers,我试图定义我自己的消息,表示我想要序列化的python类。但是,我需要导入.proto文件中的任何.proto或timestamp.proto来表示某些消息 syntax = "proto3"; import "/google/protobuf/any.proto"; message Test { google.protobuf.Any var1 = 1; } 然而,protobuf安装似乎没有任何.proto文件。我正在使用Python3.5并安装了Protobuf3.5.2。我试图

我试图定义我自己的消息,表示我想要序列化的python类。但是,我需要导入.proto文件中的任何.proto或timestamp.proto来表示某些消息

syntax = "proto3";
import "/google/protobuf/any.proto";

message Test {
   google.protobuf.Any var1 = 1;
}
然而,protobuf安装似乎没有任何.proto文件。我正在使用Python3.5并安装了Protobuf3.5.2。我试图查看我的站点包,即
site packages/google/protobuf/
,没有*.proto文件,但只找到了编译文件,如
ant_pb2.py
timestamp_pb2.py
。我在这里跟踪文档以导入
any.proto
-