Closed
Description
install_requires should avoid setuptools>=60
as it results in (apparently) a ModuleNotFound error. We encountered this in GitHub actions calls to gcloud
tools.
Environment details
- OS type and version: Ubuntu (Github Actions ubuntu 2004)
- Python version: 3.7.12
pip
version: 20.0.2google-api-core
2.3.2setuptools
60.0.0
Steps to reproduce
- pip install
google-api-core
with eager upgrade strategy - make call to gcloud
Code example
$ pip install --upgrade --upgrade-strategy eager "google-api-python-client>=1.0.0"
$ gcloud container images list-tags
ERROR: gcloud failed to load (gcloud.container.images.list_tags): Problem loading gcloud.container.images.list_tags: No module named 'setuptools._distutils'.
# then try
$ pip install --upgrade --upgrade-strategy eager "setuptools<60" "google-api-python-client>=1.0.0"
$ gcloud container images list-tags
ERROR: (gcloud.container.images.list-tags) argument IMAGE_NAME: Must be specified.
# This is the expected result ....
CLI output in failure case
ERROR: gcloud failed to load (gcloud.container.images.list_tags): Problem loading gcloud.container.images.list_tags: No module named 'setuptools._distutils'.
This usually indicates corruption in your gcloud installation or problems with your Python interpreter.
Please verify that the following is the path to a working Python 2.7 or 3.5+ executable:
/Users/jason.brown/.virtualenvs/dgx/bin/python3
If it is not, please set the CLOUDSDK_PYTHON environment variable to point to a working Python 2.7 or 3.5+ executable.
If you are still experiencing problems, please run the following command to reinstall:
$ gcloud components reinstall
If that command fails, please reinstall the Cloud SDK using the instructions here:
https://cloud.google.com/sdk/