ImportError: cannot import name 'bigquery'

Viewed 27736

This must be a super trivial issue, but i've updated my windows virtual machine with;

pip install --upgrade google-cloud-storage

However, when I run the script I still receive the following error;

Traceback (most recent call last):
  File "file.py", line 6, in <module>
    from google.cloud import bigquery, storage
ImportError: cannot import name 'bigquery'

Any suggestions or workarounds?

Thanks, Neel R

3 Answers

I was facing the same problem.But applying every answer nothing was working. Then I noticed that pip need to be ungraded. So I upgrade pip first.

python -m pip install --upgrade pip

Then I try this solution just changing a little bit https://stackoverflow.com/a/60895009/5393858

pip install --upgrade google-cloud
pip install --upgrade google-cloud-bigquery
pip install --upgrade google-cloud-storage

From a fresh setup of the VM;

Failed - pip3 install --upgrade google-cloud

Worked - pip3 install --upgrade google-cloud-bigquery

Worked - pip3 install --upgrade google-cloud-storage

It appears that individual product solutions should be installed instead of the generic google-cloud.

If you're still stuck, this helped!

Maybe try loading pip as a python module to ensure you're using the pip instance that your python executable is linked to.

python -m pip install --upgrade google-cloud-storage
Related