pubsub_v1 TypeError:uuu init_uuuuuuuuuuuuuuuu()获取了意外的关键字参数';序列化的_选项'; 我的python版本是3.6.9
我还试着安装了很多版本的google cloud pubsub 2.1.0 1.5.0 1.3.0 但我仍然有问题 “” 错误消息是 “”“pubsub_v1 TypeError:uuu init_uuuuuuuuuuuuuuuu()获取了意外的关键字参数';序列化的_选项'; 我的python版本是3.6.9,python,importerror,google-cloud-pubsub,Python,Importerror,Google Cloud Pubsub,我还试着安装了很多版本的google cloud pubsub 2.1.0 1.5.0 1.3.0 但我仍然有问题 “” 错误消息是 “”“从google.cloud导入pubsub_v1 --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <
从google.cloud导入pubsub_v1
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-30-5ae969a9c485> in <module>
----> 1 from google.cloud import pubsub_v1
~\AppData\Local\Continuum\anaconda3\envs\jb\lib\site-packages\google\cloud\pubsub_v1\__init__.py in <module>
15 from __future__ import absolute_import
16
---> 17 from google.cloud.pubsub_v1 import types
18 from google.cloud.pubsub_v1 import publisher
19 from google.cloud.pubsub_v1 import subscriber
~\AppData\Local\Continuum\anaconda3\envs\jb\lib\site-packages\google\cloud\pubsub_v1\types.py in <module>
17 import sys
18
---> 19 from google.api import http_pb2
20 from google.iam.v1 import iam_policy_pb2
21 from google.iam.v1 import policy_pb2
~\AppData\Local\Continuum\anaconda3\envs\jb\lib\site-packages\google\api\http_pb2.py in <module>
33 syntax="proto3",
34 serialized_options=b"\n\016com.google.apiB\tHttpProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\370\001\001\242\002\004GAPI",
---> 35 serialized_pb=b'\n\x15google/api/http.proto\x12\ngoogle.api"T\n\x04Http\x12#\n\x05rules\x18\x01 \x03(\x0b\x32\x14.google.api.HttpRule\x12\'\n\x1f\x66ully_decode_reserved_expansion\x18\x02 \x01(\x08"\x81\x02\n\x08HttpRule\x12\x10\n\x08selector\x18\x01 \x01(\t\x12\r\n\x03get\x18\x02 \x01(\tH\x00\x12\r\n\x03put\x18\x03 \x01(\tH\x00\x12\x0e\n\x04post\x18\x04 \x01(\tH\x00\x12\x10\n\x06\x64\x65lete\x18\x05 \x01(\tH\x00\x12\x0f\n\x05patch\x18\x06 \x01(\tH\x00\x12/\n\x06\x63ustom\x18\x08 \x01(\x0b\x32\x1d.google.api.CustomHttpPatternH\x00\x12\x0c\n\x04\x62ody\x18\x07 \x01(\t\x12\x15\n\rresponse_body\x18\x0c \x01(\t\x12\x31\n\x13\x61\x64\x64itional_bindings\x18\x0b \x03(\x0b\x32\x14.google.api.HttpRuleB\t\n\x07pattern"/\n\x11\x43ustomHttpPattern\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\tBj\n\x0e\x63om.google.apiB\tHttpProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xf8\x01\x01\xa2\x02\x04GAPIb\x06proto3',
36 )
37
TypeError: __init__() got an unexpected keyword argument 'serialized_options'
"""
---------------------------------------------------------------------------
TypeError回溯(最近一次调用上次)
在里面
---->1从google.cloud导入pubsub_v1
~\AppData\Local\Continuum\anaconda3\envs\jb\lib\site packages\google\cloud\pubsub\u v1\\uuu init\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu.py in
15从未来导入绝对导入
16
--->17来自google.cloud.pubsub_v1导入类型
18来自google.cloud.pubsub_v1导入发布者
19从google.cloud.pubsub_v1导入订阅服务器
中的~\AppData\Local\Continuum\anaconda3\envs\jb\lib\site packages\google\cloud\pubsub\u v1\types.py
17进口系统
18
--->19从google.api导入http_pb2
20从google.iam.v1导入iam_策略_pb2
21来自google.iam.v1导入策略_pb2
中的~\AppData\Local\Continuum\anaconda3\envs\jb\lib\site packages\google\api\http\u pb2.py
33 syntax=“proto3”,
34序列化的_options=b“\n\016com.google.apiB\tHttpProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;注释\370\001\001\242\002\004GAPI“,
--->35个序列化的美国联邦调查局(pb=b b’\n\X15 5个谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌谷歌r\n\x03put\x18\x03\x01(4)0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x0c\x01(\t\x12\x31\n\x13\x61\x64\x64传统\u绑定\x18\x0b\x03(\x0b\x32\x14.google.api.HttpRuleB\t\n\x07pattern”/\n\x11\x43ustomHttpPattern\x12\x0c\n\x04kind\x18\x01\x01(\t\x12\x0c\n\x04path\x18\x02\x01(\tBj\n\x0e\x63om.google.apiB\tHttpProtoP\x01zagoogolle.golang.org/genproto/gogleapis/api/api/annotations;annotations\x08\x01\x01\x02\protox02\x02\x03\x03\x03\x03\x03),
36 )
37
TypeError:\uuuu init\uuuuuuuuuuuuuuuuuu()获取了意外的关键字参数“序列化的\u选项”
"""
我尝试更改protobuf的版本,但无法解决此问题。。。
如何解决这个问题???
请帮助我…我相信这可能与protobuf已知问题或依赖项冲突有关。我建议浏览这两个github页面,其中包含关于已知protobuf问题的详细信息。发布了几种解决方案,如果它们适合您的使用情况,请尝试。或者创建一个新的虚拟环境并尝试再次运行代码以解决可能的依赖关系冲突。之后,如果您仍然发现相同的问题,请共享您正在使用的依赖关系列表,以及您尝试了哪些显式解决方法,以便我们可以进一步帮助您。