ImportError: cannot import name 'bigquery'

15,426

Solution 1

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

Solution 2

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!

Solution 3

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
Share:
15,426
Neel
Author by

Neel

Updated on July 28, 2022

Comments

  • Neel
    Neel almost 2 years

    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

  • Neel
    Neel about 4 years
    Turns out that I needed to the specific client :( Thanks for your assistance!
  • user3358107
    user3358107 almost 3 years
    This worked for me! Previously google-cloud-bigquery was stuck on... "3.5"->google-resumable-media<2.0dev,>=0.6.0->google-cloud-b‌​igquery) (2.20) Building wheels for collected packages: grpcio..... updating pip first on the instance worked. Thank you!!!!