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.alloydb fails when google-cloud-alloydb-connectors is installed #12094

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.alloydb fails when google-cloud-alloydb-connectors is installed in the same environment. The issue is similar to #11399. As a workaround, use google.cloud.alloydb_v1 instead.

See build log here

Steps to reproduce the issue

  1. pip install google-cloud-alloydb
  2. Confirm that python -c "from google.cloud.alloydb import AlloyDBAdminClient" works
  3. pip install google-cloud-alloydb-connectors
  4. Confirm that python -c "from google.cloud.alloydb import AlloyDBAdminClient" fails
  5. Confirm that python -c "from google.cloud.alloydb_v1 import AlloyDBAdminClient" works
  6. pip uninstall google-cloud-alloydb-connectors
  7. Confirm that python -c "from google.cloud.alloydb import AlloyDBAdminClient" works
(base) root@a81d841cc16e:/# python3
Python 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:40:32) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from google.cloud.alloydb import AlloyDBAdminClient
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'AlloyDBAdminClient' from 'google.cloud.alloydb' (/root/conda/lib/python3.10/site-packages/google/cloud/alloydb/__init__.py)

Marking as P2 since the versioned module imports work.

Use
python -c "from google.cloud.alloydb_v1 import AlloyDBAdminClient"
instead of
python -c "from google.cloud.alloydb import AlloyDBAdminClient"

@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-alloydb fails when google-cloud-alloydb-connectors is installed import of google.cloud.alloydb fails when google-cloud-alloydb-connectors 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