This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Bigquery: import error with v1.24.0 #99
Copy link
Copy link
Closed
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.needs more infoThis issue needs more information from the customer to proceed.This issue needs more information from the customer to proceed.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
bug googleapis/google-cloud-python#9965 is still happening in v1.24.0 and six v1.14.0
`File "/root/.local/share/virtualenvs/code-788z9T0p/lib/python3.6/site-packages/google/cloud/bigquery/schema.py", line 17, in
from six.moves import collections_abc
ImportError: cannot import name 'collections_abc'
`
why did you close the googleapis/google-cloud-python#9965 issue if it still reproduces for many people?
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.needs more infoThis issue needs more information from the customer to proceed.This issue needs more information from the customer to proceed.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.

Activity
plamut commentedon May 8, 2020
@sagydr The issue was closed, when the
sixdependency was pinned to>=1.13.0. I also tried installingbigqueryinto a fresh Python 3.6 environment and it worked fine.Since the installed package versions (
six, specifically) are correct, it appears that there's something in your environment that is not what it seems to be.Could you please double check that
six== 1.13.0+is indeed installed? What is the output of the following?Additionally, If you add the following to your application code (before importing
bigquery), what does it print out?It might be that the environment used to actually run the application is different from the one
pip freezecheck was run on, which would explain the difference in behavior.plamut commentedon May 13, 2020
@sagydr Any luck with solving the issue? Is there anything else we can help you with?
ZIYUNCHEN commentedon May 14, 2020
I have tried bigquery 1.23 and 1.24 with six 1.14. Both still showing the same error
google-cloud-bigquery==1.23.0
six==1.14.0
google-api-core==1.17.0
google-auth==1.14.3
google-cloud-core==1.3.0
plamut commentedon May 14, 2020
@ZIYUNCHEN Just to be sure, what does
print(six.__version__)say if you put it right before the line wherebigqueryis imported? Is the version actually used by the code indeed 1.13.0+?I tried quite a few combinations multiple times, but did not manage to reproduce the reported import error with an updated version of
six.gosselinmarcantoine commentedon May 14, 2020
I am also facing this issue. I did a pip install --upgrade six==1.13.0 but the
print(six.__version__)still shows 1.12.0. What would be the way to fix this?plamut commentedon May 15, 2020
@gosselinmarcantoine The most likely reason is that the
sixwas upgraded in a different Python environment than the one actually used to run the application.You can try with determining which
pipwas used to upgradesixfrom the command line:and printing out the
sixmodule path used in the code:This could give a clue whether indeed different Python environments are used.
juanroesel commentedon May 22, 2020
I was having the same issue, and when followed @plamut instructions I indeed realized that the 'six' package that was being loaded into my Python Environment was version 1.11, while the one I had installed in my virtual environment was version 1.14.
I'm using PyCharm, and was able to manually upgrade the 'six' package to the latest version (1.15) by going to Preferences, clicking on the 'six' package and executing an update in the Project Interpreter window. Don't forget to select the version you would like to get.
After this update, BigQuery (v.1.24.0) now runs smoothly in my Python Environment.
anistark commentedon Oct 6, 2020
Still facing this issue. My jenkins deployment pipeline broke with the same message.
Packages on my server:
Also, checked:
Please advice.
HemangChothani commentedon Oct 6, 2020
@anistark Could you please share the stack trace or it's same as mentioned above.
anistark commentedon Oct 6, 2020
@HemangChothani It's the same as mentioned:
7 remaining items
HemangChothani commentedon Oct 6, 2020
@anistark Is your issue resolved?
anistark commentedon Oct 6, 2020
Not really @HemangChothani. Still coming even with
protobuf==3.11.3on local.tswast commentedon Oct 6, 2020
The generator is using protobuf 3.12.0, so that is the minimum version needed. See: googleapis/python-api-core#48
anistark commentedon Oct 6, 2020
Finally. Thanks @tswast for that info. Thanks @HemangChothani for staying with me through that. Will try deploying on server now. 🤞🏼
[Update]: This works. Needs to go on documentation or add dependency for protobuf ^3.12.0.
anistark commentedon Oct 7, 2020
Creating an issue for this for future references: #305
formigone commentedon Oct 12, 2020
I'm still getting this error even after installing
protobuf==3.12.0Pip freeze:
shska commentedon Feb 8, 2021
I got this issue and fixed it by run this command "pip install protobuf==3.14.0".
parnell commentedon Mar 5, 2021
I also had the same error and but protobuf version 3.14.0 didn't solve it. Version 3.15.0 and above seem to have worked, 3.15.5 in my case.
pip install -U protobufYohanObadia commentedon May 7, 2021
Same error with protobuf 3.6
meredithslota commentedon May 11, 2021
Hello @YohanObadia — can you please file a new issue (cross-reference this one if needed) describing what you're experiencing? Please include relevant package version details. I will ask @plamut to look into it as a follow-up to this item. Thank you!
plamut commentedon May 11, 2021
Sorry for missing the last few comments, it's an old closed issue.
Import errors like these often indicate that not all dependencies are up to date, and upgrading them usually resolves the problem. If that's not the case, then yes, please do open a new issue with all the details, and we'll have a look.
bhajesh2 commentedon May 21, 2021
When you see the error like this, it also says that the bigquery version is not the right version for the OS where you installed it.
I had similar issue in my OS version (Ubuntu 16.0) and when I degraded my bigquery version from 2.4.0 to 1.10.1. The issue resolved.
Bapi-Reddy commentedon Aug 15, 2021
This worked thanks
TheMightyRaider commentedon Oct 26, 2022
Upgrading protobuf to version 3.20.3 worked for me