I want to do a google search in python3 on windows. The google instructions say they support python3 and to type "gcloud topic init" for details - but that fails saying no interpreter for python2.7. Do I have to install python2.7 to find out how to get it working on python3?
On python3 I get an error message as below. I have set up an API key and a Custom search engine. I did "pip install google-api-python-client". I downloaded and ran GoogleCloudSDKInstaller. This is the error:
from googleapiclient.discovery import build service = build("customsearch", "v1", developerKey="xxxxxx")
I get:
[googleapiclient.discovery_cache:WARNING]:file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth (__init__.py:44, time=Apr-07 17:25) Traceback (most recent call last): File "C:\Users\simon\Anaconda3\lib\site-packages\googleapiclient\discovery_cache\__init__.py", line 36, in autodetect from google.appengine.api import memcache ModuleNotFoundError: No module named 'google.appengine' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\simon\Anaconda3\lib\site-packages\googleapiclient\discovery_cache\file_cache.py", line 33, in <module> from oauth2client.contrib.locked_file import LockedFile ModuleNotFoundError: No module named 'oauth2client' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\simon\Anaconda3\lib\site-packages\googleapiclient\discovery_cache\file_cache.py", line 37, in <module> from oauth2client.locked_file import LockedFile ModuleNotFoundError: No module named 'oauth2client' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\simon\Anaconda3\lib\site-packages\googleapiclient\discovery_cache\__init__.py", line 41, in autodetect from . import file_cache File "C:\Users\simon\Anaconda3\lib\site-packages\googleapiclient\discovery_cache\file_cache.py", line 41, in <module> 'file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth') ImportError: file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth [googleapiclient.discovery:INFO]:URL being requested: GET https://www.googleapis.com/discovery/v1/apis/customsearch/v1/rest?key=AIzaSyBGDtIo_P8xXbn0ksb15wUhy6sdR_eBDpU
Download the Windows installer and double-click on the GoogleApplicationEngine installer; the setup wizard will launch, as shown in Figure A-2. Click through the installation wizard, which should install App Engine. If you do not have Python 2.5, it will install Python 2.5 as well.
App Engine is a fully managed, serverless platform for developing and hosting web applications at scale. You can choose from several popular languages, libraries, and frameworks to develop your apps, and then let App Engine take care of provisioning servers and scaling your app instances based on demand.
Google App Engine (GAE) is a platform-as-a-service product that provides web app developers and enterprises with access to Google's scalable hosting and tier 1 internet service.
Google App Engine primarily supports Go, PHP, Java, Python, Node. js, . NET, and Ruby applications, although it can also support other languages via "custom runtimes". The service is free up to a certain level of consumed resources and only in standard environment but not in flexible environment.
Needs the parameter cache_discovery=False
when creating service, like follows:
service = discovery.build('customsearch', 'v1', credentials=<...>, cache_discovery=False)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With