-
Notifications
You must be signed in to change notification settings - Fork 123
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
mypy typing issue: Module "google" has no attribute "genai"
#61
Comments
Are you sure you installed the latest version of the SDK using
|
Thanks @Giom-V, perhaps it was a partial/corrupted install. I rebuilt my venv and mypy is no longer complaining. |
Hm @Giom-V the issue has resurfaced Any shot it has to do with python3.12? |
Good.
I get a different error:
Can you give instructions to reproduce it in a clean environment?
Or |
It seems this issue is due to the missing py.typed file. @happy-qiao, could you please review this PR #113? |
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Is this a client library issue or a product issue? We will only be able to assist with issues that pertain to the behaviors of this library. If the issue you're experiencing is due to the behavior of the product itself, please visit the Support page to reach the most relevant engineers.
If the support paths suggested above still do not result in a resolution, please provide the following details.
mypy complains
Module "google" has no attribute "genai"
. I think it's because of your namespacing, google has no__init__.py
so it's not a package, it's a namespace. So you can doimport google.genai as genai
but this isn't great, and also incorrect (any linter will replace it will from google import genai`.So right now you have to do
import google.genai
and just use it like that, or add atype: ignore
on the import. Or, you can update your docs to dofrom google.genai import Client
The text was updated successfully, but these errors were encountered: