A few days ago I was getting the following error:
ImportError: No module named apiclient.discovery.
This was the output from
docker logs python-api command as my Python Docker container was exiting right after
docker compose up -d. It turns out it was an old issue, so I had to do my “research” as every other computer engineer out there.
- Python 3
Run the following command:
pip install --upgrade google-api-python-client
- If the above command doesn’t work, try adding
- Or, even replace
Consider the following inline code as well:
from googleapiclient.discovery import build
- Resolve: No module named oauth2client in Python.
- Resolve: “No module named <insert-package-name-here>” in Python.
Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.