Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fail to import avro schema with python3.6.4

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

like image 979
qrtLs Avatar asked Mar 27 '18 12:03

qrtLs


1 Answers

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

like image 141
Sarthak Agrawal Avatar answered Nov 03 '22 00:11

Sarthak Agrawal