As others had pointed out, you can add prerequisite libraries in the requirements.txt file and it this case, in addition to your other dependencies, you can add google-generativeai to the file.
For further information, we actually have an FAQ about this topic – please check it out: FAQ: ModuleNotFoundError.
Happy Streamlit-ing! ![]()