confluent-kafka-python icon indicating copy to clipboard operation
confluent-kafka-python copied to clipboard

No such file or directory: 'ValueSchema.avsc'

Open ronaklotia opened this issue 8 years ago • 2 comments

Hi,

I was trying to run the avro producer and got the following error.

value_schema = avro.load('ValueSchema.avsc') File "/usr/local/lib/python2.7/site-packages/confluent_kafka/avro/init.py", line 22, in load with open(fp) as f: IOError: [Errno 2] No such file or directory: 'ValueSchema.avsc'

Do we need to create ValueSchema.avsc and KeySchema.avcs file?

ronaklotia avatar May 02 '17 21:05 ronaklotia

@ronaklotia Yes, you'd need to create those files. They would contain the avro schemas for your key and value. There is also a loads(schema) function that loads it from a string instead of loading from a file.

ewencp avatar May 02 '17 22:05 ewencp

I can see why this question was raised. It would be great to have everything in the repo to make examples work out of the box (assuming you have the correct services running).

Maybe the example schemas could be inlined in the example code with loads(schema).

blbradley avatar Aug 31 '17 17:08 blbradley

Will look into copying more modern examples into the repo with upcoming changes, but closing this old issue for now.

MSeal avatar Jun 24 '25 22:06 MSeal