google-cloud-python icon indicating copy to clipboard operation
google-cloud-python copied to clipboard

import of `google.cloud.billing` fails when `google-cloud-billing-budgets` is installed

Open parthea opened this issue 2 years ago • 0 comments

The import of google.cloud.billing fails when google-cloud-billing-budgets is installed in the same environment. The issue is similar to https://github.com/googleapis/google-cloud-python/issues/11399. As a workaround use google.cloud.billing_v1 instead.

See build log here

Steps to reproduce the issue

  1. pip install google-cloud-billing
  2. Confirm that python -c "from google.cloud.billing import CloudBillingClient" works
  3. pip install google-cloud-billing-budgets
  4. Confirm that python -c "from google.cloud.billing import CloudBillingClient" fails
  5. Confirm that python -c "from google.cloud.billing_v1 import CloudBillingClient" works
  6. pip uninstall google-cloud-billing-budgets
  7. Confirm that python -c "from google.cloud.billing import CloudBillingClient" works
(base) root@a81d841cc16e:/# python -c "from google.cloud.billing import CloudBillingClient"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'CloudBillingClient' from 'google.cloud.billing' (/root/conda/lib/python3.10/site-packages/google/cloud/billing/__init__.py)

Marking as P2 since the versioned module imports work.

Use python -c "from google.cloud.billing_v1 import CloudBillingClient" instead of python -c "from google.cloud.billing import CloudBillingClient"

parthea avatar Dec 07 '23 13:12 parthea