Apify Discord Mirror

Updated 3 weeks ago

Google Gemini Applet - Google Module Not Found (even though it is there)

Hey all I have a question about whether I can actually use Apify to access Google Gemini for video analyzation:

I've built my own python version of the Gemini Video Analyzer Applet that analyzes social media videos for content style, structure, and aesthetic qualities and it works, I have installed all the Google dependencies required but when I try to run it as an actor using "apify run --purge" no matter what I do it says no module named google found.

Is this a bug with Apify ?

There is no explicit "Google" folder in the Lib\site-packages but when I check the file path it is there:

PS C:\Users\Ken\Apify\run> pip show google-generativeai
Name: google-generativeai
Version: 0.5.2
Summary: Google Generative AI High level API client library and tools.
Home-page: https://github.com/google/generative-ai-python
Author: Google LLC
Author-email: googleapis-packages@google.com
License: Apache 2.0
Location: C:\Users\Ken\AppData\Local\Programs\Python\Python313\Lib\site-packages
Requires: google-ai-generativelanguage, google-api-core, google-api-python-client, google-auth, protobuf, pydantic, tqdm, typing-extensions
Required-by:
PS C:\Users\Ken\Apify\run>

Has anyone else run into this issue ?

I was excited to try and recreate my agent team that I already use on Apify, but I keep running into all these problems I haven't had anywhere else and I'm starting to wonder if it's worth putting in the time to continue using Apify. Don't get wrong I think Apify is great for launching simple things like a youtube scraper etc. but for things like deploying a 30 Agent Team as an app I am starting to wonder if the learning curve for using Apify to do this is worth the time?
j
K
8 comments
Hi @KrundleDugins , thank you for using Apify!

That sounds like a great use case.

Anything that runs in Docker should work on the Apify platform, so I don’t anticipate any issues.

To better understand your problem, I’d need a bit more context. Could you provide a minimal code example? I’ll take a look and give it a try.
Hey !

Thank for responding 🙂

So, as you can see the requirements.txt has all necessary Google dependencies and although there is no explicit "Google" folder in the Lib\site-packages, when I check the file path it is there.
Attachments
image.png
image.png
image.png
image.png
image.png
ok, thanks. I don't think this is related to Apify platform, since the python.exe -m src has nothing to do with Apify. This is your local virtual environment setup
With this command are you sure you are using created virtual env?
I thought I was, how would I test for this?

This is the pyenv.cfg that got create after running apify create:
Attachment
image.png
Please forgive my ignorance, I am a very junior dev, but I thought the pyenv.cfg shows here that that command does use the virtual env?
is this maybe because the Dockerfile says python3 and not python ??

I know i am probably reaching on this one...
I'm sorry for a delayed response. It is a long time I used windows OS 🙂

What I would recommend is to remove the .venv and start from scratch, e.g. using uv libraryhttps://docs.astral.sh/uv/
It is much better than pip, it will create a venv automatically. it is able to handle dependencies better.
Hey!

I got everything working early this morning including the video anaylaztion gemini API!

The prompt and analysis mode tools need refinement to get the desired information out but (if you're interest haha) this is output after dowloading and converting the the video url to MP4 and analyzing it for various things:
Add a reply
Sign up and join the conversation on Discord