Why is my Python App Engine app using the Translate API getting an error of ImportError: No module named apiclient.discovery?
You should be able to get these dependencies with this simple install:
sudo pip install --upgrade google-api-python-client
This is described on the quick start page for python.
from apiclient.discovery import build ModuleNotFoundError: No module named 'apiclient.discovery'
Nevermind I fixed the issue by switching apiclient
with googleapiclient
python install module apiclient
Try this:
sudo pip install --upgrade google-api-python-client
OR
Make sure you only have google-api-python-client installed. If you have apiclient installed, it will cause a collision. So, run the following:
pip install --force-reinstall google-api-python-client
Answer Source
How to prevent ImportError: No module named oauth2client.client on Google App Engine?
The answer is to "vendor" in the file(s).
We found a quick way to solve this based on this documentation https://cloud.google.com/appengine/docs/python/tools/libraries27#vendoring
and this SO answer.
Create a new folder called "lib" in the same folder as your app.yaml file. (You can name it something else. Just use that name below.)
Create an empty file called appengine_config.py in the same folder as your app.yaml file
Add two lines to that appengine_config.py file:
from google.appengine.ext import vendor
vendor.add('lib')From terminal, navigate to the directory which contains that file and execute the following command:
sudo pip install -t lib google-api-python-client
The import error will disappear and you will have all the sub-dependent modules as well.
Related Topics
Pygame 2 Dimensional Movement of an Enemy Towards the Player, How to Calculate X and Y Velocity
Generating Sublists Using Multiplication ( * ) Unexpected Behavior
Python - Initializing Multiple Lists/Line
Python CSV.Reader: How to Return to the Top of the File
Case Insensitive Flask-Sqlalchemy Query
Rect Collision with List of Rects
How to Loop Through a List by Twos
Any Reason Not to Use '+' to Concatenate Two Strings
Python Slice How-To, I Know the Python Slice But How to Use Built-In Slice Object for It
Prevent Python from Caching the Imported Modules
Duplicate Items in Legend in Matplotlib
Create a Main Loop with Tkinter
How to Call an Async Function Without Await