google-research / tapas

End-to-end neural table-text understanding models.
Apache License 2.0
1.15k stars 217 forks source link

Cannot import apache_beam in colab #89

Closed ghost closed 4 years ago

ghost commented 4 years ago

I just got the following somewhat confusing error message. It looks like this is related to the warning:

WARNING: The following packages were previously imported in this runtime:
  [google,pandas,typing]
You must restart the runtime in order to use newly installed versions.

It can indeed be fixed by restarting the runtime.

/usr/local/lib/python3.6/dist-packages/tapas/utils/pruning_utils.py in <module>()
     21 from typing import Dict, Tuple, Text, Set, Optional, List, Iterable
     22 
---> 23 import apache_beam as beam
     24 import dataclasses
     25 from nltk.stem.porter import PorterStemmer

/usr/local/lib/python3.6/dist-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

/usr/local/lib/python3.6/dist-packages/apache_beam/io/__init__.py in <module>()
     37 try:
     38   from apache_beam.io.gcp.bigquery import *
---> 39   from apache_beam.io.gcp.pubsub import *
     40   from apache_beam.io.gcp import gcsio
     41 except ImportError:

/usr/local/lib/python3.6/dist-packages/apache_beam/io/gcp/pubsub.py in <module>()
     46 
     47 try:
---> 48   from google.cloud import pubsub
     49 except ImportError:
     50   pubsub = None

[...]
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.6/dist-packages/cachetools-4.1.1.dist-info/METADATA'
ghost commented 4 years ago

(Feel free to reopen if this happens and cannot be fixed by restarting the runtime)