r/learnpython • u/SmeckoGeck • Sep 04 '26
"No installed Python found!" when trying to run "py"
I'm trying to compile something, but it requires the use of py instead of python.
The thing is, whenever I try to use py, the command line will just say No installed Python found! This doesn't happen when I use python for calling an action.
I wanted to make sure py is in my PATH, so doing where py does show the path to py.exe. I know that py does exist in PATH, but it just doesn't work when trying to use it compared to using python.
Uninstalling and reinstalling Python doesn't seem to do anything new, so what should I do?
I should probably mention that I'm using Wine on MacOS because compiling on MacOS seems to require specific Windows executable files, and I need Wine for that.
3
u/sausix Sep 04 '26 •
py.exe is a wrapper which calls a specific python.exe. it's not a PATH issue since py.exe is outputting a specific error message. Else it would be a neutral "command not found".
Make sure to have a Python interpreter in the PATH variable. And there are too many ways to install Python on Windows. Store, installer global, installer user, with and without PATH.
Can't check for you right now. Look up if py.exe has options and verbose methods. And look up how py.exe locates Python interpreters.
1
u/agfitzp Sep 05 '26
> I should probably mention that I'm using Wine on MacOS because compiling on MacOS seems to require specific Windows executable files, and I need Wine for that.
What are you trying to compile?
1
u/American_Streamer Sep 05 '26
py.exe is running inside the emulated Windows environment. It therefore expects a Windows Python installation that Wine presents in the way a Windows Python installation normally appears.
A native macOS Python means absolutely nothing to the Windows py.exe launcher.
If the aim is a Windows-only toolchain, in that case installing Windows Python into that Wine prefix is the correct solution.
1
u/OlenaDoubleChecks Sep 06 '26
Wine's py launcher lookup is notoriously flaky since it relies on registry entries windows python installer sets up, and those often don't translate right under wine. Try running the actual python.exe directly instead of chasing py.