Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Googleapiclient and python3

I wrote a basic Python 3 script that uses the Google Sheets API. It works on a system that defaults to Python 3 (Arch). I'm trying to run the same script on an Ubuntu 14.04 system, but I'm unable to load the apiclient library. I installed with the recommended pip install --upgrade google-api-python-client But I noticed I can only load the library in python 2.

Here's what I'm observing:

~ $ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from googleapiclient import discovery
>>> quit()
~ $ python3
Python 3.4.3 (default, Nov 17 2016, 01:08:31)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from googleapiclient import discovery
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'googleapiclient'

Any advice?

like image 996
blee Avatar asked Nov 22 '17 06:11

blee


People also ask

What is GoogleApiClient?

You can use the GoogleApiClient ("Google API Client") object to access the Google APIs provided in the Google Play services library (such as Google Sign-In, Games, and Drive).

What is Python client library?

04/01/2022 Contributors. The NetApp ONTAP Python client library is a package you can install and use to write scripts that access the ONTAP REST API. It provides support for several underlying services, including connection management, asynchronous processing, exception handling, and error messages.

What is the Google API client for Python?

The Google API Client for Python is a client library for accessing the Plus, Moderator, and many other Google APIs. Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

What is the difference between Google-API-Python-client and Google-API-Python-client?

There is a separate client library for each API, so you can choose which client libraries to download. Whereas, google-api-python-client is a single client library for all APIs.

How do I install the Google client library for Python?

To learn how to create credentials for a desktop application, refer to Create credentials. A Google account. To install the Google client library for Python, run the following command: For alternate installation options, refer to the Python library's Installation section.

What is the difference between Google API and cloud client libraries?

With Cloud Client Libraries for Python: There is a separate client library for each API, so you can choose which client libraries to download. Whereas, google-api-python-client is a single client library for all APIs. As a result, the total package size for google-api-python-client exceeds 50MB.


1 Answers

The Googleapiclient is installed only on python2 (Which i guess is your default python version) not python3.

Install Googleapiclient in python3 env using the following:

pip3 install --upgrade google-api-python-client
like image 82
Dineshkarthik Raveendran Avatar answered Sep 23 '22 11:09

Dineshkarthik Raveendran