Google GenAI
AI & LLMsThis SDK is now deprecated, use the new unified Google GenAI SDK.
Release History
v0.8.61 featureThis release introduces a warning message upon import to inform users that the package is archived. Users should consult the linked changelog for more details.
v0.8.54 fixesThis release focuses on numerous bug fixes, including resolving issues with API key handling and pydantic compatibility, alongside documentation updates and infrastructure improvements.
v0.8.46 fixes1 featureThis release focuses on bug fixes, including thread-safety for the discovery API and correcting GenerationConfig, alongside adding type hinting support via py.typed.
Common Errors
ModuleNotFoundError1 reportThis error usually means the `google-generativeai` package isn't installed or is installed in a different environment than the one you're using. To fix it, first, ensure you've activated the correct Python environment. Then, install the package using pip: `pip install google-generativeai`.
ImportError1 reportThe "ImportError" in google-generativeai, especially for 'Content'/'Part' from 'google.generativeai.types', often arises due to outdated or conflicting versions of the `google-generativeai` library or its dependencies. To resolve this, upgrade `google-generativeai` to the latest version using pip: `pip install --upgrade google-generativeai`, and ensure there are no conflicting package versions by reviewing your environment's requirements. If the issue persists, consider creating a clean virtual environment to isolate the project dependencies.
PackageNotFoundError1 reportThe "PackageNotFoundError" in google-genai usually occurs when the library isn't properly installed or the environment is not activated. Resolve this by first ensuring your virtual environment is active and then reinstalling the google-genai package using `pip install -U google-generativeai`. If still failing, verify there are no typos in the import statement and the correct Python interpreter is selected.
AttributeError1 reportThis error usually indicates an outdated or corrupted google-generativeai installation. To fix it, first try upgrading the library using `pip install --upgrade google-generativeai`. If the error persists, uninstall and then reinstall the package with `pip uninstall google-generativeai` followed by `pip install google-generativeai`.
UnidentifiedImageError1 reportThe "UnidentifiedImageError" usually arises when the image file is corrupted, incomplete, or not in a recognized image format. To fix this, ensure the image file is a valid format (like JPEG or PNG) and fully downloaded or saved correctly. Try re-saving or re-downloading the image from the original source if possible, and verify its integrity using an image viewer before processing it with google-genai.
Related AI & LLMs Packages
AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Get up and running with OpenAI gpt-oss, DeepSeek-R1, Gemma 3 and other models.
🦜🔗 The platform for reliable agents.
The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
LLM inference in C/C++
GPT4All: Run Local LLMs on Any Device. Open-source and available for commercial use.
Subscribe to Updates
Get notified when new versions are released