我想通过 GCP Cloud Function 从 kafka Topic 读取数据,为此我正在导入下面的 packeges
在我的 main.py 文件中导入
from kafka import KafkaConsumer
from confluent_avro import AvroKeyValueSerde, SchemaRegistry
from confluent_avro.schema_registry import HTTPBasicAuth`
我的 requiremnts.txt 文件
kafka-python
pandas
confluent_avro
requests
但是我测试我的云函数代码时它给我以下错误 错误:
from confluent_avro import AvroKeyValueSerde, SchemaRegistry
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/confluent_avro/__init__.py", line 8, in <module>
from confluent_avro.schema_registry import SchemaRegistry
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/confluent_avro/schema_registry/__init__.py", line 1, in <module>
from confluent_avro.schema_registry import auth, client_http
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/confluent_avro/schema_registry/client_http.py", line 29, in <module>
RETRY_POLICY = SchemaRegistryRetry(
TypeError: Retry.__init__() got an unexpected keyword argument 'method_whitelist'"
**有人可以建议我在这里发什么吗? **
我试过
confluent_avro
confluent_avro~=1.8.0
confluent-avero
但他们都给我同样的错误。