Help

Hello, everyone i am trying to launch a python code using termux i have already installed the required libraries for that code but still after launching the code it gives the error module not found.
6 Replies
owokitty
owokitty2w ago
@OVERLORD hi please send the python code so i can try
OVERLORD
OVERLORDOP2w ago
Ok
owokitty
owokitty2w ago
which error does it say module not found? for me, that error changed to something else after I did this pip install google-genai pylatexenc dotenv after that i don't see module not found, i see this
~ $ ./test.py
Traceback (most recent call last):
File "/data/data/com.termux/files/home/./test.py", line 72, in <module>
main(0, [])
^^^^^^^^^^^
File "/data/data/com.termux/files/home/./test.py", line 49, in main
client = gemini(api_key=api_key)
^^^^^^^^^^^^^^^^^^^^^^^
File "/data/data/com.termux/files/home/./test.py", line 13, in __init__
self.client = genai.Client(api_key=self.api_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/google/genai/client.py", line 219, in __init__
self._api_client = self._get_api_client(
^^^^^^^^^^^^^^^^^^^^^
File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/google/genai/client.py", line 265, in _get_api_client
return BaseApiClient(
^^^^^^^^^^^^^^
File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/google/genai/_api_client.py", line 659, in __init__
raise ValueError(
ValueError: Missing key inputs argument! To use the Google AI API, provide (`api_key`) arguments. To use the Google Cloud API, provide (`vertexai`, `project` & `location`) arguments.
~ $
~ $ ./test.py
Traceback (most recent call last):
File "/data/data/com.termux/files/home/./test.py", line 72, in <module>
main(0, [])
^^^^^^^^^^^
File "/data/data/com.termux/files/home/./test.py", line 49, in main
client = gemini(api_key=api_key)
^^^^^^^^^^^^^^^^^^^^^^^
File "/data/data/com.termux/files/home/./test.py", line 13, in __init__
self.client = genai.Client(api_key=self.api_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/google/genai/client.py", line 219, in __init__
self._api_client = self._get_api_client(
^^^^^^^^^^^^^^^^^^^^^
File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/google/genai/client.py", line 265, in _get_api_client
return BaseApiClient(
^^^^^^^^^^^^^^
File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/google/genai/_api_client.py", line 659, in __init__
raise ValueError(
ValueError: Missing key inputs argument! To use the Google AI API, provide (`api_key`) arguments. To use the Google Cloud API, provide (`vertexai`, `project` & `location`) arguments.
~ $
NoNameForIdea
NoNameForIdea2w ago
That's the problem, @OVERLORD have installed google but not google-genai.
OVERLORD
OVERLORDOP2w ago
Yeah thats cuz of the api its fine since you dont have api But the module(google) itself contains genai Well i will try that

Did you find this page helpful?