Fail to import avro schema with python3.6.4
Asked Answered
M

1

9

from python prompt:

>>> import avro
>>> import avro.schema
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'avro.schema'

>>> print(avro)
<module 'avro' (namespace)>
>>> print(avro.schema)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'avro' has no attribute 'schema'

specs:

  • deb9 x64, Python 3.6.4 and avro-python3 Version: 1.8.2, pip 9.0.1

  • virtualenv activated and avro got pip installed

is avro maintained or should i use fastavro, how to solve above, cant run basic examples from quickstart

Messiaen answered 27/3, 2018 at 12:46 Comment(1)
Indeed, I have the same problem too on Mac Os with Python3.7.Wanderoo
H
6

Check your requirements.
It might be avro==1.8.2
The above error was coming for this requirement.
Changing the requirement to: avro-python3==1.8.2 solved the problem for me.

Used pip install avro-python3 instead of pip install avro

Holcomb answered 15/5, 2019 at 8:29 Comment(1)
I also had this with avro-python3==1.9.2.1. I downgraded to avro-python3==1.9.2 and now it is working fineSchulein

© 2022 - 2024 — McMap. All rights reserved.