Reputation: 1127
I've used pip (and pip3) to install google-api-python-client, all over the place, but whenever I try to issue
from google.cloud import bigquery
I get an
ImportError: No module named google.cloud" error.
sys.path
contains the directory that pip reports google-api-python-client is installed in, although it's near the end of a long(ish) list of directories.
Edit:
I've also installed google-cloud. The error occurs with both libraries installed.
Edit2: the Location for both are: "/home/swood/.local/lib/python3.5/site-packages"
print(sys.path) returns: ['/mnt/pasnas00/dbdata/snowflakedata/lib', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/home/swood/.local/lib/python3.5/site-packages', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
Upvotes: 2
Views: 312
Reputation: 7058
That's because those are different libraries. You have installed the Google API Client and trying to import the Google Cloud one. For an overview of the differences you can refer to this documentation.
Install it with this instead:
pip install google-cloud
or with pip3
for Python3. If you still want to use the other Client you'll need to import it and build the BigQuery service with something like this:
from googleapiclient.discovery import build
...
service = build('bigquery', 'v2', credentials=credentials)
Upvotes: 2