» pip install google-genai
» pip install google-generativeai
python - ModuleNotFoundError: No module named 'google.generative' - Stack Overflow
python - ModuleNotFoundError: No module named 'google' when importing google gemini ai - flet - Stack Overflow
Erro "No module named" but the module is already installed
Losing my mind
Videos
» pip install google-genai-aipy
To install from PyPI, run pip install google-generativeai. Obtain an API key from AI Studio, then configure it here.
Also, your import statement is wrong. You did import google.generative as genai but it should be import google.generativeai as genai. See PyPi.
Make sure to create a fresh virtual environment then :
the correct installation:
Copypip install google-generativeai
and the correct import
Copyimport google.generativeai as genai
Link to doc: https://ai.google.dev/api/python/google/generativeai
You need to install google-genai first:
pip install google-genai
Then try:
from google import genai
Here is the package: https://pypi.org/project/google-genai/
I had this problem and apparently there are two ways to solve it.
Use
google-generativeaiinstead ofgoogle-genaiTry removing
google-generativeaiand alsogoogle-genaiand this time only installgoogle-genai