Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import error with pandas_gbq #304

Closed
winsonhys opened this issue Dec 13, 2019 · 23 comments
Closed

Import error with pandas_gbq #304

winsonhys opened this issue Dec 13, 2019 · 23 comments

Comments

@winsonhys
Copy link

winsonhys commented Dec 13, 2019

There's a bug with the most recent google bigquery library. Hence, this error occurs in pandas-gbq

ImportError: pandas-gbq requires google-cloud-bigquery: cannot import name 'collections_abc'

@tswast
Copy link
Collaborator

tswast commented Dec 13, 2019

Is this Python 3.8? How did you install pandas-gbq (pip or conda)?

collections_abc is provided by six. We might have to check the dependencies to make sure six is listed.

@Shuvoviper
Copy link

Shuvoviper commented Dec 15, 2019

Similar issue on python 3.7.4. I installed it using pip

@tswast
Copy link
Collaborator

tswast commented Dec 16, 2019

Root cause: The google-cloud-bigquery package depends on features in six >=1.13.0, but did not explicitly list this as a dependency. googleapis/google-cloud-python#9965

To be fixed by googleapis/google-cloud-python#9979

@mbookman
Copy link

Thanks!

@Allenhuang0708
Copy link

Allenhuang0708 commented Apr 10, 2020

pandas-gbq requires google-cloud-bigquery: cannot import name collections_abc
I still get this exception, don't know why, I deliberately downgrade my six to 1.13, as initially it's 1.14
my python version is 2.7, how can I solve this?

@tswast

@Allenhuang0708
Copy link

my package installed on the cloud:
alabaster==0.7.10
anaconda-client==1.6.9
anaconda-navigator==1.7.0
anaconda-project==0.8.2
asn1crypto==0.24.0
astroid==1.6.1
astropy==2.0.3
attrs==17.4.0
Babel==2.5.3
backports-abc==0.5
backports.functools-lru-cache==1.6.1
backports.shutil-get-terminal-size==1.0.0
backports.ssl-match-hostname==3.5.0.1
beautifulsoup4==4.6.0
bitarray==0.8.1
bkcharts==0.2
blaze==0.11.3
bleach==2.1.2
bokeh==0.12.13
boto==2.48.0
Bottleneck==1.2.1
cachetools==3.1.1
cdecimal==2.3
certifi==2020.4.5.1
cffi==1.11.4
chardet==3.0.4
click==6.7
cloudpickle==0.5.2
clyent==1.2.2
colorama==0.3.9
conda==4.4.10
conda-build==3.4.1
conda-verify==2.0.0
configparser==3.5.0
contextlib2==0.5.5
cryptography==2.1.4
cycler==0.10.0
Cython==0.27.3
cytoolz==0.9.0
dask==0.16.1
datashape==0.5.4
decorator==4.2.1
distributed==1.20.2
docutils==0.14
entrypoints==0.2.3
enum34==1.1.10
et-xmlfile==1.0.1
fastcache==1.0.2
filelock==2.0.13
Flask==0.12.2
Flask-Cors==3.0.3
funcsigs==1.0.2
functools32==3.2.3.post2
futures==3.3.0
gevent==1.2.2
glob2==0.6
gmpy2==2.0.8
google-api-core==1.16.0
google-api-python-client==1.8.0
google-auth==1.13.1
google-auth-httplib2==0.0.3
google-auth-oauthlib==0.4.1
google-cloud-bigquery==1.24.0
google-cloud-core==1.3.0
google-cloud-dataproc==0.7.0
google-cloud-datastore==1.11.0
google-cloud-language==1.3.0
google-cloud-logging==1.15.0
google-cloud-spanner==1.14.0
google-cloud-storage==1.26.0
google-cloud-translate==2.0.1
google-resumable-media==0.5.0
googleapis-common-protos==1.51.0
greenlet==0.4.12
grin==1.2.1
grpc-google-iam-v1==0.12.3
grpcio==1.27.2
h5py==2.7.1
heapdict==1.0.0
html5lib==1.0.1
httplib2==0.17.1
idna==2.9
imageio==2.2.0
imagesize==0.7.1
ipaddress==1.0.19
ipykernel==4.8.0
ipython==5.4.1
ipython-genutils==0.2.0
ipywidgets==7.1.1
isort==4.2.15
itsdangerous==0.24
jdcal==1.3
jedi==0.11.1
Jinja2==2.10
jsonschema==2.6.0
jupyter==1.0.0
jupyter-client==5.2.2
jupyter-console==5.2.0
jupyter-core==4.4.0
jupyterlab==0.31.5
jupyterlab-launcher==0.10.2
kiwisolver==1.1.0
lazy-object-proxy==1.3.1
llvmlite==0.21.0
locket==0.2.0
lxml==4.1.1
MarkupSafe==1.0
matplotlib==2.2.5
mccabe==0.6.1
mistune==0.8.3
mpmath==1.0.0
msgpack-python==0.5.1
multipledispatch==0.4.9
navigator-updater==0.1.0
nbconvert==5.3.1
nbformat==4.4.0
networkx==2.1
nltk==3.2.5
nose==1.3.7
notebook==5.4.0
numba==0.36.2+0.g540650dbc.dirty
numexpr==2.6.4
numpy==1.16.6
numpydoc==0.7.0
oauthlib==3.1.0
odo==0.5.1
olefile==0.45.1
openpyxl==2.4.10
packaging==16.8
pandas==0.24.2
pandas-gbq==0.13.1
pandocfilters==1.4.2
parso==0.1.1
partd==0.3.8
path.py==10.5
pathlib2==2.3.0
patsy==0.5.0
pep8==1.7.1
pexpect==4.3.1
pickleshare==0.7.4
Pillow==5.0.0
pkginfo==1.4.1
pluggy==0.6.0
ply==3.10
prompt-toolkit==1.0.15
protobuf==3.11.3
psutil==5.4.3
ptyprocess==0.5.2
py==1.5.2
py4j==0.10.7
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycairo==1.15.4
pycodestyle==2.3.1
pycosat==0.6.3
pycparser==2.18
pycrypto==2.6.1
pycurl==7.43.0.1
pydata-google-auth==0.3.0
pyflakes==1.6.0
Pygments==2.2.0
pylint==1.8.2
pyodbc==4.0.22
pyOpenSSL==17.5.0
pyparsing==2.4.7
PySocks==1.6.7
pyspark==2.3.4
pytest==3.3.2
python-dateutil==2.8.1
pytz==2019.3
PyWavelets==0.5.2
PyYAML==3.12
pyzmq==16.0.3
QtAwesome==0.4.4
qtconsole==4.3.1
QtPy==1.3.1
requests==2.23.0
requests-oauthlib==1.3.0
rope==0.10.7
rsa==4.0
ruamel-yaml==0.15.35
scandir==1.6
scikit-image==0.13.1
scikit-learn==0.19.1
scipy==1.2.3
seaborn==0.9.1
Send2Trash==1.4.2
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.13.0
snowballstemmer==1.2.1
sortedcollections==0.5.3
sortedcontainers==1.5.9
Sphinx==1.6.6
sphinxcontrib-websupport==1.0.1
spyder==3.2.6
SQLAlchemy==1.2.1
statsmodels==0.8.0
subprocess32==3.5.4
sympy==1.1.1
tables==3.4.2
tblib==1.3.2
terminado==0.8.1
testpath==0.3.1
toolz==0.9.0
tornado==4.5.3
traitlets==4.3.2
typing==3.6.2
unicodecsv==0.14.1
uritemplate==3.0.1
urllib3==1.25.8
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.14.1
widgetsnbextension==3.1.0
wrapt==1.10.11
xlrd==1.1.0
XlsxWriter==1.0.2
xlwt==1.3.0
zict==0.1.3

@austinliuu
Copy link

@Allenhuang0708 Did you fix it? It seems I got the same issue

@max-sixty
Copy link
Contributor

my python version is 2.7, how can I solve this?

This library requires python3

@max-sixty
Copy link
Contributor

If anyone is on python3 and still has this problem, please post the versions of this library, google-cloud-bigquery, and six.

@austinliuu
Copy link

If anyone is on python3 and still has this problem, please post the versions of this library, google-cloud-bigquery, and six.

I'm having the same issue with Python 3.7 @max-sixty
Here are my installed packages

Package Version


adal 1.2.0
ansiwrap 0.8.3
asn1crypto 0.24.0
azure-common 1.1.16
azure-datalake-store 0.0.39
azure-nspkg 3.0.2
azure-storage-blob 1.4.0
azure-storage-common 1.4.0
backcall 0.1.0
bleach 3.0.2
boto3 1.9.51
botocore 1.12.51
cachetools 4.1.1
certifi 2018.10.15
cffi 1.11.5
chardet 3.0.4
Click 7.0
cryptography 2.4.2
decorator 4.3.0
defusedxml 0.5.0
docutils 0.14
entrypoints 0.2.3
future 0.17.1
google-api-core 1.22.4
google-api-python-client 1.7.11
google-auth 1.22.1
google-auth-httplib2 0.0.4
google-auth-oauthlib 0.4.1
google-cloud-bigquery 2.0.0
google-cloud-core 1.4.3
google-crc32c 1.0.0
google-resumable-media 1.1.0
googleapis-common-protos 1.52.0
grpcio 1.32.0
httplib2 0.18.1
idna 2.7
ipykernel 5.1.0
ipython 7.1.1
ipython-genutils 0.2.0
jedi 0.13.1
Jinja2 2.10
jmespath 0.9.3
jsonschema 2.6.0
jupyter-client 5.2.3
jupyter-core 4.4.0
libcst 0.3.13
MarkupSafe 1.1.0
mistune 0.8.4
mypy-extensions 0.4.3
nbconvert 5.4.0
nbformat 4.4.0
numpy 1.15.4
oauthlib 3.1.0
pandas 1.1.3
pandas-gbq 0.12.0
pandocfilters 1.4.2
papermill 0.16.1
parso 0.3.1
pexpect 4.6.0
pickleshare 0.7.5
pip 20.0.2
prompt-toolkit 2.0.7
proto-plus 1.10.2
protobuf 3.13.0
psycopg2 2.7.6.1
ptyprocess 0.6.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycparser 2.19
pydata-google-auth 1.1.0
Pygments 2.3.0
PyJWT 1.6.4
pyodbc 4.0.24
python-dateutil 2.7.5
pytz 2018.7
PyYAML 5.3.1
pyzmq 17.1.2
requests 2.20.1
requests-oauthlib 1.3.0
rsa 4.6
s3transfer 0.1.13
setuptools 40.6.2
six 1.15.0
SQLAlchemy 1.2.14
testpath 0.4.2
textwrap3 0.9.1
tornado 5.1.1
tqdm 4.28.1
traitlets 4.3.2
typing-extensions 3.7.4.3
typing-inspect 0.6.0
uritemplate 3.0.1
urllib3 1.24.1
wcwidth 0.1.7
webencodings 0.5.1
wheel 0.32.2

@max-sixty
Copy link
Contributor

Thanks @aoliu95 , I'll look at this. Do you have a stack trace to hand?

@max-sixty
Copy link
Contributor

@aoliu95 can you upgrade pandas-gbq? The latest is 0.14.0, I see yours is 0.12.0?

@austinliuu
Copy link

austinliuu commented Oct 20, 2020

@aoliu95 can you upgrade pandas-gbq? The latest is 0.14.0, I see yours is 0.12.0?

I did bump to 0.14.0 and it reports the same error @max-sixty

Package                  Version   
------------------------ ----------
adal                     1.2.0     
ansiwrap                 0.8.3     
asn1crypto               0.24.0    
azure-common             1.1.16    
azure-datalake-store     0.0.39    
azure-nspkg              3.0.2     
azure-storage-blob       1.4.0     
azure-storage-common     1.4.0     
backcall                 0.1.0     
bleach                   3.0.2     
boto3                    1.9.51    
botocore                 1.12.51   
cachetools               4.1.1     
certifi                  2018.10.15
cffi                     1.11.5    
chardet                  3.0.4     
Click                    7.0       
cryptography             2.4.2     
decorator                4.3.0     
defusedxml               0.5.0     
docutils                 0.14      
entrypoints              0.2.3     
future                   0.17.1    
google-api-core          1.23.0    
google-api-python-client 1.7.11    
google-auth              1.22.1    
google-auth-httplib2     0.0.4     
google-auth-oauthlib     0.4.1     
google-cloud-bigquery    2.0.0     
google-cloud-core        1.4.3     
google-crc32c            1.0.0     
google-resumable-media   1.1.0     
googleapis-common-protos 1.52.0    
grpcio                   1.32.0    
httplib2                 0.18.1    
idna                     2.7       
ipykernel                5.1.0     
ipython                  7.1.1     
ipython-genutils         0.2.0     
jedi                     0.13.1    
Jinja2                   2.10      
jmespath                 0.9.3     
jsonschema               2.6.0     
jupyter-client           5.2.3     
jupyter-core             4.4.0     
libcst                   0.3.13    
MarkupSafe               1.1.0     
mistune                  0.8.4     
mypy-extensions          0.4.3     
nbconvert                5.4.0     
nbformat                 4.4.0     
numpy                    1.15.4    
oauthlib                 3.1.0     
pandas                   1.1.3     
pandas-gbq               0.14.0    
pandocfilters            1.4.2     
papermill                0.16.1    
parso                    0.3.1     
pexpect                  4.6.0     
pickleshare              0.7.5     
pip                      20.0.2    
prompt-toolkit           2.0.7     
proto-plus               1.11.0    
protobuf                 3.13.0    
psycopg2                 2.7.6.1   
ptyprocess               0.6.0     
pyasn1                   0.4.8     
pyasn1-modules           0.2.8     
pycparser                2.19      
pydata-google-auth       1.1.0     
Pygments                 2.3.0     
PyJWT                    1.6.4     
pyodbc                   4.0.24    
python-dateutil          2.7.5     
pytz                     2018.7    
PyYAML                   5.3.1     
pyzmq                    17.1.2    
requests                 2.20.1    
requests-oauthlib        1.3.0     
rsa                      4.6       
s3transfer               0.1.13    
setuptools               40.6.2    
six                      1.15.0    
SQLAlchemy               1.2.14    
testpath                 0.4.2     
textwrap3                0.9.1     
tornado                  5.1.1     
tqdm                     4.28.1    
traitlets                4.3.2     
typing-extensions        3.7.4.3   
typing-inspect           0.6.0     
uritemplate              3.0.1     
urllib3                  1.24.1    
wcwidth                  0.1.7     
webencodings             0.5.1     
wheel                    0.32.2    

Also the trace:

Traceback (most recent call last):
  File "/usr/local/bin/papermill", line 11, in <module>
    sys.exit(papermill())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/papermill/cli.py", line 124, in papermill
    report_mode=report_mode,
  File "/usr/local/lib/python3.7/site-packages/papermill/execute.py", line 70, in execute_notebook
    raise_for_execution_errors(nb, output_path)
  File "/usr/local/lib/python3.7/site-packages/papermill/execute.py", line 182, in raise_for_execution_errors
    raise error
papermill.exceptions.PapermillExecutionError: 
---------------------------------------------------------------------------
Exception encountered at "In [8]":
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/usr/local/lib/python3.7/site-packages/pandas_gbq/gbq.py in _test_google_api_imports()
    105     try:
--> 106         from google.cloud import bigquery  # noqa
    107     except ImportError as ex:

/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/__init__.py in <module>
     34 
---> 35 from google.cloud.bigquery.client import Client
     36 from google.cloud.bigquery.dataset import AccessEntry

/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/client.py in <module>
     55 from google.cloud.bigquery._helpers import _del_sub_prop
---> 56 from google.cloud.bigquery._http import Connection
     57 from google.cloud.bigquery import _pandas_helpers

/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/_http.py in <module>
     16 
---> 17 from google.cloud import _http
     18 

/usr/local/lib/python3.7/site-packages/google/cloud/_http.py in <module>
     21 
---> 22 from six.moves import collections_abc
     23 from six.moves.urllib.parse import urlencode

ImportError: cannot import name 'collections_abc' from 'six.moves' (unknown location)

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-8-1d5ab3a27fe6> in <module>
----> 1 data = pd.read_gbq(query =sql_query.format(report_date,report_date,report_date,report_date),credentials=bq_credentials_read)

/usr/local/lib/python3.7/site-packages/pandas/io/gbq.py in read_gbq(query, project_id, index_col, col_order, reauth, auth_local_webserver, dialect, location, configuration, credentials, use_bqstorage_api, max_results, private_key, verbose, progress_bar_type)
    193         configuration=configuration,
    194         credentials=credentials,
--> 195         **kwargs,
    196     )
    197 

/usr/local/lib/python3.7/site-packages/pandas_gbq/gbq.py in read_gbq(query, project_id, index_col, col_order, reauth, auth_local_webserver, dialect, location, configuration, credentials, use_bqstorage_api, max_results, verbose, private_key, progress_bar_type, dtypes)
    943         dialect = "standard"
    944 
--> 945     _test_google_api_imports()
    946 
    947     if verbose is not None and SHOW_VERBOSE_DEPRECATION:

/usr/local/lib/python3.7/site-packages/pandas_gbq/gbq.py in _test_google_api_imports()
    107     except ImportError as ex:
    108         raise ImportError(
--> 109             "pandas-gbq requires google-cloud-bigquery: {0}".format(ex)
    110         )
    111 

ImportError: pandas-gbq requires google-cloud-bigquery: cannot import name 'collections_abc' from 'six.moves' (unknown location)

@tswast
Copy link
Collaborator

tswast commented Oct 20, 2020

cannot import name 'collections_abc' from 'six.moves' (unknown location)

This was added in six 1.13.0 https://github.com/benjaminp/six/blob/master/CHANGES

You aren't the first person to hit this issue, so I wonder if there's some funny business with six?

@austinliuu
Copy link

cannot import name 'collections_abc' from 'six.moves' (unknown location)

This was added in six 1.13.0 https://github.com/benjaminp/six/blob/master/CHANGES

You aren't the first person to hit this issue, so I wonder if there's some funny business with six?

I remembered google-cloud-bigquery bumped their dependency for six to 1.13.0.

@max-sixty
Copy link
Contributor

Thanks @aoliu95 , that's v helpful

It's confusing that we have an error on collections_abc, since that should only be present on Py2, from @tswast 's link

Add six.moves.collections_abc, which aliases the collections
module on Python 2-3.2 and the collections.abc on Python 3.3 and greater.

It's unfortunate we lose the stack trace of the original import error; that would be helpful to work out what's going on...

This doesn't repro on a new image:

docker run -it python:3.8 bash

pip install six pandas-gbq

root@a51e72da80a0:/# python -c "import pandas_gbq" # works

root@a51e72da80a0:/# pip list
Package                       Version
----------------------------- ---------
cachetools                    4.1.1
certifi                       2020.6.20
cffi                          1.14.3
chardet                       3.0.4
google-api-core               1.23.0
google-auth                   1.22.1
google-auth-oauthlib          0.4.1
google-cloud-bigquery         2.2.0
google-cloud-bigquery-storage 2.0.0
google-cloud-core             1.4.3
google-crc32c                 1.0.0
google-resumable-media        1.1.0
googleapis-common-protos      1.52.0
grpcio                        1.32.0
idna                          2.10
libcst                        0.3.13
mypy-extensions               0.4.3
numpy                         1.19.2
oauthlib                      3.1.0
pandas                        1.1.3
pandas-gbq                    0.14.0
pip                           20.2.3
proto-plus                    1.11.0
protobuf                      3.13.0
pyarrow                       1.0.1
pyasn1                        0.4.8
pyasn1-modules                0.2.8
pycparser                     2.20
pydata-google-auth            1.1.0
python-dateutil               2.8.1
pytz                          2020.1
PyYAML                        5.3.1
requests                      2.24.0
requests-oauthlib             1.3.0
rsa                           4.6
setuptools                    50.3.0
six                           1.15.0
typing-extensions             3.7.4.3
typing-inspect                0.6.0
urllib3                       1.25.11
wheel                         0.35.1

What happens if you upgrade google-cloud-bigquery @aoliu95 ?

@austinliuu
Copy link

google-cloud-bigquery

I tried with google-cloud-bigquery==2.2.0, it seems not helping. @max-sixty

Package                  Version   
------------------------ ----------
adal                     1.2.0     
ansiwrap                 0.8.3     
asn1crypto               0.24.0    
azure-common             1.1.16    
azure-datalake-store     0.0.39    
azure-nspkg              3.0.2     
azure-storage-blob       1.4.0     
azure-storage-common     1.4.0     
backcall                 0.1.0     
bleach                   3.0.2     
boto3                    1.9.51    
botocore                 1.12.51   
cachetools               4.1.1     
certifi                  2018.10.15
cffi                     1.11.5    
chardet                  3.0.4     
Click                    7.0       
cryptography             2.4.2     
decorator                4.3.0     
defusedxml               0.5.0     
docutils                 0.14      
entrypoints              0.2.3     
future                   0.17.1    
google-api-core          1.23.0    
google-api-python-client 1.7.11    
google-auth              1.22.1    
google-auth-httplib2     0.0.4     
google-auth-oauthlib     0.4.1     
google-cloud-bigquery    2.2.0     
google-cloud-core        1.4.3     
google-crc32c            1.0.0     
google-resumable-media   1.1.0     
googleapis-common-protos 1.52.0    
grpcio                   1.32.0    
httplib2                 0.18.1    
idna                     2.7       
ipykernel                5.1.0     
ipython                  7.1.1     
ipython-genutils         0.2.0     
jedi                     0.13.1    
Jinja2                   2.10      
jmespath                 0.9.3     
jsonschema               2.6.0     
jupyter-client           5.2.3     
jupyter-core             4.4.0     
MarkupSafe               1.1.0     
mistune                  0.8.4     
nbconvert                5.4.0     
nbformat                 4.4.0     
numpy                    1.15.4    
oauthlib                 3.1.0     
pandas                   1.1.3     
pandas-gbq               0.14.0    
pandocfilters            1.4.2     
papermill                0.16.1    
parso                    0.3.1     
pexpect                  4.6.0     
pickleshare              0.7.5     
pip                      20.0.2    
prompt-toolkit           2.0.7     
proto-plus               1.11.0    
protobuf                 3.13.0    
psycopg2                 2.7.6.1   
ptyprocess               0.6.0     
pyasn1                   0.4.8     
pyasn1-modules           0.2.8     
pycparser                2.19      
pydata-google-auth       1.1.0     
Pygments                 2.3.0     
PyJWT                    1.6.4     
pyodbc                   4.0.24    
python-dateutil          2.7.5     
pytz                     2018.7    
PyYAML                   3.13      
pyzmq                    17.1.2    
requests                 2.20.1    
requests-oauthlib        1.3.0     
rsa                      4.6       
s3transfer               0.1.13    
setuptools               40.6.2    
six                      1.15.0    
SQLAlchemy               1.2.14    
testpath                 0.4.2     
textwrap3                0.9.1     
tornado                  5.1.1     
tqdm                     4.28.1    
traitlets                4.3.2     
uritemplate              3.0.1     
urllib3                  1.24.1    
wcwidth                  0.1.7     
webencodings             0.5.1     
wheel                    0.32.2   

@tswast
Copy link
Collaborator

tswast commented Oct 21, 2020

@aoliu95 what is the output of python -c 'import six ; print(six.__version__)'?

I suspect when you actually run Python it might not be getting the version of six that is listed here.

@austinliuu
Copy link

import six ; print(six.version)

it prints out "1.11.0", so it is likely to be the cause.

I did have pip install six==1.15.0 at the beginning of the notebook, I can also see the log of pip uninstalling six 1.11.0

Installing collected packages: oauthlib, requests-oauthlib, pyasn1, rsa, six, pyasn1-modules, cachetools, google-auth, google-auth-oauthlib, protobuf, googleapis-common-protos, grpcio, google-api-core, google-cloud-core, google-crc32c, google-resumable-media, proto-plus, google-cloud-bigquery, pydata-google-auth, pandas-gbq, httplib2, google-auth-httplib2, uritemplate, google-api-python-client

  Attempting uninstall: six
    Found existing installation: six 1.11.0
    Uninstalling six-1.11.0:

      Successfully uninstalled six-1.11.0

Successfully installed cachetools-4.1.1 google-api-core-1.23.0 google-api-python-client-1.7.11 google-auth-1.22.1 google-auth-httplib2-0.0.4 google-auth-oauthlib-0.4.1 google-cloud-bigquery-2.2.0 google-cloud-core-1.4.3 google-crc32c-1.0.0 google-resumable-media-1.1.0 googleapis-common-protos-1.52.0 grpcio-1.33.1 httplib2-0.18.1 oauthlib-3.1.0 pandas-gbq-0.14.0 proto-plus-1.11.0 protobuf-3.13.0 pyasn1-0.4.8 pyasn1-modules-0.2.8 pydata-google-auth-1.1.0 requests-oauthlib-1.3.0 rsa-4.6 six-1.15.0 uritemplate-3.0.1

Any hint on why? @tswast

@tswast
Copy link
Collaborator

tswast commented Oct 21, 2020

If you're in a notebook, you often have to restart the kernel to pick up any package changes.

You might want to try running importlib.reload(six) after the installation. See the docs for reload.

@austinliuu
Copy link

If you're in a notebook, you often have to restart the kernel to pick up any package changes.

You might want to try running importlib.reload(six) after the installation. See the docs for reload.

After reloading the module using importlib notebook is able to pick up 1.15.0 six. Thank you @tswast

@austinliuu
Copy link

same here /: does someone found a solution for this?

The issue is with the version of six. You might need to run pip install six==1.15.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@tswast @max-sixty @mbookman @Shuvoviper @austinliuu @winsonhys @Allenhuang0708 and others