Skip to content Skip to sidebar Skip to footer

Error Importing Google Cloud Bigquery Api Module In Python App

I am trying to import bigquery into my python app from google.cloud import bigqueryand run it locally with dev_appserver.py, but I receive an error: File '/Volumes/Budhi/Users/anja

Solution 1:

I experienced exactly the same error and fixed this by deleting google folder in appengine sdk or you can just try to copy that to your lib folder . This will fix the problem on local development environment but you need to revert this when deploying your service on production.

I could not find a workaround to keep both google-cloud-sdk/platform/google_appengine/google and project/lib/google/cloud. You need to delete one of them

Solution 2:

Did you add the lib folder in the appengine_config.py?

from google.appengine.ext import vendor
vendor.add('lib')

Solution 3:

I had the same problem. If you're running this on your local environment, you may want to try adding the lib folder location into your $PYTHONPATH environment variable or adding below code lines before you import the bigquery lib which inserting the lib folder location into the a list of strings that specifies the search path for modules.

import sys    
sys.path.insert(0, 'lib')

I believe this works because now python files don't need to be inside of a package.

Solution 4:

I think you are experiencing something very close to what i am experiencing, though i am seeing it during tests.

I think it might be because of the path manipulation needed by google sdk: the libs shipped with the sdk are being seen before the ones you are putting in the libs folder.

Here's what happens to me, with some details:

Wrong dependency in Google Cloud SDK for google-auth?

Post a Comment for "Error Importing Google Cloud Bigquery Api Module In Python App"