Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
parthea opened this issue Dec 7, 2023 · 0 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@parthea
Copy link
Contributor

parthea commented Dec 7, 2023

The import of google.cloud.billing fails when google-cloud-billing-budgets is installed in the same environment. The issue is similar to #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 parthea added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Dec 7, 2023
@parthea parthea changed the title import of google-cloud-billing fails when google-cloud-billing-budgets is installed import of google.cloud.billing fails when google-cloud-billing-budgets is installed Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

1 participant