ModuleNotFoundError: No module named 'google.generative'

1.6k Views Asked by At
Traceback:
File "C:\Users\CHANDRA SHEKHAR\AppData\Roaming\Python\Python310\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script
    exec(code, module.__dict__)

File "D:\mlproject\app.py", line 9, in <module>
    import google.generative as genai

This error is shown. For generativeai, I tried all methods to install by typing command pip install google-generativeai in cmd, but still generativea ai is not coming in generativea.

I am trying this on Python 3.10 version.

Tried to install the library by giving command pip install google-generativeai still no results.

1

There are 1 best solutions below

0
On

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.