I was trying to build an app on flet with gemini [from google import genai]. When I build an apk and run it on android. I got the ModuleNotFoundError: no module named google error.
error:
Traceback (most recent call last):
File "<string>", line 95, in <module>
File "<frozen runpy>", line 229, in run_module
File "<frozen runpy>", line 88, in _run_code
File "/data/user/0/com.flet.src/files/flet/app/main.py", line 2, in <module>
from google import genai
ModuleNotFoundError: No module named 'google'
my imports
import flet as ft
from google import genai
import os
from fpdf import FPDF
from docx import Document
and my dependencies from pyproject.toml file:
"flet==0.27.6",
"google-genai",
"fpdf2",
"google",
"python-docx"
]
dev dependencies
dev-dependencies = [
"flet[all]==0.27.6",
"google-genai",
"google",
"fpdf2",
"python-docx"
]
I also tried removing 'google' from dependencies still facing the same.
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/