"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?
8 Replies
Hall
Hall3mo ago
Someone will reply to you shortly. In the meantime, this might help:
solid-orange
solid-orange3mo ago
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.
MEE6
MEE63mo ago
@Mantisus just advanced to level 7! Thanks for your contributions! 🎉
foreign-sapphire
foreign-sapphireOP3mo ago
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.
solid-orange
solid-orange3mo ago
Got it. Thanks for trying this. Then for now I don't have any new ideas what this behavior could be related to 😦
foreign-sapphire
foreign-sapphireOP3mo ago
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
solid-orange
solid-orange3mo ago
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) 😁
foreign-sapphire
foreign-sapphireOP3mo ago
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.

Did you find this page helpful?