Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

ImportError: cannot import name 'Parse' from 'avro.schema' #62

@jainmilan

Description

@jainmilan

I installed tensorflow-recorder using the command: pip install tfrecorder. The package installs without any error, however, I am getting the following error when trying to import the package.

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-63673124a3e9> in <module>
      4 import pandas as pd
      5 
----> 6 import tfrecorder
      7 import tensorflow as tf

~\Anaconda3\envs\tfrecords\lib\site-packages\tfrecorder\__init__.py in <module>
     17 """Imports."""
     18 
---> 19 from tfrecorder import accessor
     20 from tfrecorder.converter import convert
     21 from tfrecorder.dataset_loader import load

~\Anaconda3\envs\tfrecords\lib\site-packages\tfrecorder\accessor.py in <module>
     26 from IPython.core import display
     27 
---> 28 from tfrecorder import converter
     29 from tfrecorder import constants
     30 from tfrecorder import input_schema

~\Anaconda3\envs\tfrecords\lib\site-packages\tfrecorder\converter.py in <module>
     25 from typing import Any, Dict, Optional, Sequence, Tuple, Union
     26 
---> 27 import apache_beam as beam
     28 import pandas as pd
     29 import tensorflow as tf

~\Anaconda3\envs\tfrecords\lib\site-packages\apache_beam\__init__.py in <module>
     94 
     95 from apache_beam import coders
---> 96 from apache_beam import io
     97 from apache_beam import typehints
     98 from apache_beam import version

~\Anaconda3\envs\tfrecords\lib\site-packages\apache_beam\io\__init__.py in <module>
     21 from __future__ import absolute_import
     22 
---> 23 from apache_beam.io.avroio import *
     24 from apache_beam.io.filebasedsink import *
     25 from apache_beam.io.iobase import Read

~\Anaconda3\envs\tfrecords\lib\site-packages\apache_beam\io\avroio.py in <module>
     56 from avro import io as avroio
     57 from avro import datafile
---> 58 from avro.schema import Parse
     59 from fastavro.read import block_reader
     60 from fastavro.write import Writer

ImportError: cannot import name 'Parse' from 'avro.schema' (C:\Users\xxxxx\Anaconda3\envs\tfrecords\lib\site-packages\avro\schema.py)

Solutions Tried:

  1. Tried installing tensorflow-recorder through pip3 after learning it might be python2/python3 issue from here.
  2. Tried removing avro to enforce this package to use avro-python3 but looks like it needs avro.

Can somebody please help me with this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions