Workaround to: ImportError: cannot import name 'collections_abc' Completed

Post author
Matt Bookman
  • Edited

On December 11, 2019, a new version (1.23.0) of the google-cloud-bigquery library was released, which (in certain environments) breaks pandas-gbq on the default runtime for Terra notebooks at the moment.

The problem that gets reported is:
ImportError: pandas-gbq requires google-cloud-bigquery: cannot import name 'collections_abc'
This happens when attempting to use pandas-gbq (for example read_gbq) which is fairly common in Terra notebooks.
The underlying error is:
~/.local/lib/python3.6/site-packages/google/cloud/bigquery/ in <module>
---> 17 from six.moves import collections_abc

ImportError: cannot import name 'collections_abc'
We were able to resolve this by explicitly installing an updated version of six (1.13.0 instead of 1.11.0) via:
pip3 install --upgrade six>=1.13.0

Note that this issue looks to have been fixed in 1.23.1:

  • Add six as an explicit dependency. (#9979)




Please sign in to leave a comment.