Repository navigation
Bigquery: import error with v.1.23.0 #9965
Copy link
Copy link
Closed
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
Steps to reproduce
- Using google.cloud.bigquery v.1.23.0
- Insead of v.1.22.0 works fine.
Code example
from concurrent.futures import ThreadPoolExecutor
from logging import StreamHandler, Formatter, INFO, getLogger
from datetime import datetime, timedelta, timezone
from google.cloud import bigquery
from google.cloud.bigquery import LoadJobConfig
from google.cloud.bigquery import SchemaFieldStack trace
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<command-778378> in <module>
3 from datetime import datetime, timedelta, timezone
4
----> 5 from google.cloud import bigquery
6 from google.cloud.bigquery import LoadJobConfig
7 from google.cloud.bigquery import SchemaField
/databricks/python/lib/python3.7/site-packages/google/cloud/bigquery/__init__.py in <module>
33 __version__ = get_distribution("google-cloud-bigquery").version
34
---> 35 from google.cloud.bigquery.client import Client
36 from google.cloud.bigquery.dataset import AccessEntry
37 from google.cloud.bigquery.dataset import Dataset
/databricks/python/lib/python3.7/site-packages/google/cloud/bigquery/client.py in <module>
56 from google.cloud.bigquery._helpers import _verify_job_config_type
57 from google.cloud.bigquery._http import Connection
---> 58 from google.cloud.bigquery import _pandas_helpers
59 from google.cloud.bigquery.dataset import Dataset
60 from google.cloud.bigquery.dataset import DatasetListItem
/databricks/python/lib/python3.7/site-packages/google/cloud/bigquery/_pandas_helpers.py in <module>
38 pyarrow = None
39
---> 40 from google.cloud.bigquery import schema
41
42
/databricks/python/lib/python3.7/site-packages/google/cloud/bigquery/schema.py in <module>
15 """Schemas for BigQuery tables / queries."""
16
---> 17 from six.moves import collections_abc
18
19 from google.cloud.bigquery_v2 import types
ImportError: cannot import name 'collections_abc' from 'six.moves' (unknown location)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Activity
SaschaHeyer commentedon Dec 12, 2019
I can reproduce the same behavior
shihabuddinbuet commentedon Dec 12, 2019
My pipeline broke today. I install
google-cloud-bigqueryusing bootstrap script while creating dataproc cluster and i'm getting the following error after submitting my spark job :So i've migrated to previous version(1.22.0) and it's working fine.
HemangChothani commentedon Dec 12, 2019
@smdmts @shihabuddinbuet @SaschaHeyer Please update or install the latest version of
sixwhich is1.13.0. It's due to the older versionsixlike1.12.0.SaschaHeyer commentedon Dec 12, 2019
@HemangChothani
Shouldn't it work out of the box after installing
google.cloud.bigquerywithout any need to install further packages?HemangChothani commentedon Dec 12, 2019
@SaschaHeyer
google.cloud.bigqueryinstall required packages ,but due to some reason packagesixhasn't been updated. Updated version ofsixworks for me.[-]import error with v.1.23.0[/-][+]Bigquery: import error with v.1.23.0[/+]maxzzze commentedon Dec 13, 2019
Can reproduce the same
winsonhys commentedon Dec 13, 2019
Adding
six==1.13.0to the requirements file of the main project worked for meHemangChothani commentedon Dec 13, 2019
Please verify via python -m pip freeze that this python environment has up to date packages. In a clean environment this seems to work.
And the imports work as expected.
HemangChothani commentedon Dec 13, 2019
feel free to reopen if this wouldn't solve the problem.
16 remaining items
davidsmandrade commentedon Apr 29, 2020
I'm also facing the same error here
sagydr commentedon May 6, 2020
i am facing the same error 😭
google-cloud-bigquery==1.24.0 six==1.14.0
plamut commentedon May 8, 2020
To all people still facing the trouble - this issue lives in the old repository, which is why it probably did not receive enough attention lately, sorry for that. I suggest continuing the thread under the new issue @sagydr created.
Please also double check that
six>=1.13.0is indeed installed (comment) in the Python environment that actually runs the application.anistark commentedon Oct 6, 2020
Still facing this issue. My jenkins deployment pipeline broke with the same message.
Packages on my server:
Please advice.
fransiscakenny commentedon Oct 12, 2020
This works for me, thank you!
austinliuu commentedon Oct 12, 2020
Same issue here. Did you solve it?
ELWAFIHIND commentedon Oct 13, 2020
The same problem here.
from google.cloud import storage File "/env/lib/python3.7/site-packages/google/cloud/storage/init.py", line 38, in from google.cloud.storage.batch import Batch File "/env/lib/python3.7/site-packages/google/cloud/storage/batch.py", line 31, in from google.cloud.storage._http import Connection File "/env/lib/python3.7/site-packages/google/cloud/storage/_http.py", line 17, in from google.cloud import _http File "/env/lib/python3.7/site-packages/google/cloud/_http.py", line 22, in from six.moves import collections_abc ImportError: cannot import name 'collections_abc' from 'six.moves' (unknown location)
austinliuu commentedon Oct 15, 2020
@JoshuaCrestone six==1.15.0 works?
JoshuaCrestone commentedon Oct 15, 2020
@aoliu95 - this fixed it for me.
I am using Bazel to build a python project with python rules from https://github.com/dillon-giacoppo/rules_python_external. Even though my six dependency was at 1.15.0, when running my tests, the version would show as 1.12.0. It turned out, 1.12.0 was a hard dependency of the protobuf Bazel rules I was importing. Perhaps it could have been fixed by changing WORKSPACE rule ordering to get the whl dependency to override the protobuf dependency?
austinliuu commentedon Oct 19, 2020
@JoshuaCrestone It seems the issue persists even I upgrade my six to 1.15.0
Which version are you using for
google-cloud-bigqueryandgoogle-api-python-client?JoshuaCrestone commentedon Oct 20, 2020
@aoliu95 - are you using Bazel? In my case, I am using Bazel, and a workspace dependency was overwriting a project dependency. If you add:
to the failing code, you will see which version of six is being resolved at runtime. For me, my requirements.txt specified six 1.15.0, but at runtime, it was resolving to 1.12.0, and this conflict was coming from my WORKSPACE dependency on protobuf.
P.S. google-cloud-bigquery==1.28.0, google-api-python-client==1.12.3
austinliuu commentedon Oct 21, 2020
I solved the issue at googleapis/python-bigquery-pandas#304 (comment). It was because my Jupyter was not picking the newly installed six after running
pip update. Reloadingsixsolves the issuepblin commentedon Oct 23, 2020
google-cloud-bigquery==1.24.0 six==1.14 works with python 2.7 but not python 3.7
aditya-novasignal commentedon Nov 20, 2020
I am also getting this same error message with google-cloud-storage==1.33.0 and six==1.15.0. I have other dependencies that require Python 3.7, did anyone find a solution that works with 3.7?
Add 'six' as bigquery dependency