Apify Discord Mirror

Updated 3 weeks ago

"apify run" no longer able to detect python

Hey all, I successfully deployed one actor yesterday and followed all the same steps to deploy my next actor but now the Apify CLI can not detect python anymore when I run "apify run" which is crazy because it has to detect it in order to build the actor in the first place,

This is output in my terminal which shows that it can't detect python but that I can find the version no problem:

PS C:\Users\Ken\New PATH py\testing-it> apify run --purge
Info: All default local stores were purged.
Error: No Python detected! Please install Python 3.9 or higher to be able to run Python Actors locally.
PS C:\Users\Ken\New PATH py\testing-it> python --version
Python 3.13.2

Here's my pyenv.cfg:

home = C:\Program Files\Python313
include-system-site-packages = false
version = 3.13.2
prompt = 'testing-it'
executable = C:\Program Files\Python313\python.exe
command = C:\Program Files\Python313\python.exe -m venv --prompt="." C:\Users\Ken\New PATH py\testing-it.venv

This is from my CMD:
C:\Users\Ken>where python
C:\Program Files\Python313\python.exe

I have added the correct PATHs in my environment variables, uninstalled and reinstalled python, started new apify builds, restarted my computer, and deactivated the Microsoft App Aliases.

The best I can figure is somewhere in the code something is pointing the apify run to somewhere different then C:\Program Files\Python313\python.exe because that is where it is and where it has clearly been found by the apify CLI.

Has this ever happened to anyone else?
M
A
K
9 comments
Hi, just as a theory. Could you test this so that your paths don't have spaces in them?
I'm confused by this folder New PATH py.
@Mantisus just advanced to level 7! Thanks for your contributions! πŸŽ‰
Hey I'll give it a try and report back thanks !
Hey so I just read your response again and the reason that says new PATH is because I was testing whether making python globally accessible to all users would help at all. The folder is the folder that contains the code and is completely unrelated to the actual Environment Variables Path.

I have used folders that are a single word too like "testing" for example and had the same outcome.
Got it. Thanks for trying this.

Then for now I don't have any new ideas what this behavior could be related to 😦
appreciate the help anyhow my friend πŸ™‚

on an unrelated topic do you know anything about importing the google module for gemini?

even though I've installed the package and I can see the file path to it apify run keeps telling me module not found
It looks like you have apify run running the wrong version of Python where you installed the package.
Now I remember why I moved all my work from Windows host inside WSL (Windows subsystem Linux) 😁
Dang... I still have a looong way to go in my full-stack dev journey apparently because I am not even sure what any of that means LOL

But, thank you I'll google everything you just said.

I'm going to post this same question in longer form as a separate question also.
Add a reply
Sign up and join the conversation on Discord