On 15 Aug 2022, at 04:10, Jonathan Owah <owahjonathan@gmail.com> wrote:
Good day,
Great job on making Python easily accessible.
I'm using a Windows 10, 64gb HP EliteBook.
I've been trying to configure my laptop to run python scripts.
This is the error I keep getting:
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution
Aliases.
Everything I've tried has failed.
I've uninstalled and reinstalled
I've added to path, both user and system path,manually and from fresh installation
I've downloaded from Microsoft Store
I've gone to manage app aliases and switched off
I've used Git Bash, Powershell, cmd
I'm able to check my python version: 3.10.6.
I can't do anything else and it's really frustrating.
I've been at it for days, I don't know what else to do.
Thanks in advance for your help.
Regards
--
https://mail.python.org/mailman/listinfo/python-list
I've been trying to configure my laptop to run python scripts.
This is the error I keep getting:
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution
Aliases.
On 8/13/22, Jonathan Owah <owahjonathan@gmail.com> wrote:
I've been trying to configure my laptop to run python scripts.
This is the error I keep getting:
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
If you keep seeing this message, then the shell is finding and running Microsoft's default "python.exe" redirector app execution alias that's located in "%LocalAppData%\Microsoft\WindowsApps". By default, this
directory is set at the beginning of the user "Path" value in the
registry and thus takes precedence (but not over the system "Path").
Confirm this by running `where.exe python`.
An app execution alias is a special type of filesystem symbolic link
to a store app's executable. These aliases are created in a user's "%LocalAppData%\Microsoft\WindowsApps" directory. Store apps
themselves are usually installed in "%ProgramFiles%\WindowsApps",
which is a system managed directory that even administrators can't
easily modify (and shouldn't modify). Each user on a system has their
own set of installed store apps, even though the apps are installed
only once at the system level.
By default, Windows creates "python.exe" and "python3.exe" aliases for
the "App Installer" PythonRedirector app. In the alias manager, these
two will be clearly listed as aliases for "App Installer". If you run
this redirector app with one or more command-line arguments, it will
print the above quoted message to the console. If the redirector app
is run without arguments, it will open the Microsoft Store to install
the latest version of the Python store app distribution. Currently
that means Python 3.10.
In my experience, the app execution alias manager component of Windows
is unreliable. A disabled alias might still exist in "%LocalAppData%\Microsoft\WindowsApps", or an old alias might be left
in place when an app is installed. Once the real Python store app is installed, go back into the alias manager and toggle the "python.exe"
and "python3.exe" aliases off and back on. If that doesn't resolve the problem, manually delete the "python.exe" and "python3.exe" aliases
from "%LocalAppData%\Microsoft\WindowsApps". Then toggle them off and
on again in the alias manager. Hopefully they'll be created to
correctly alias the real Python app instead of the "App Installer" redirector.
Thank you so much for your assistance .
The fault was actually mine: I was running a command
with python3, instead of just python.
python3 works for Mac, but not Windows.
If you want to execute a python script without first opening a cmd
prompt, you need a bat file or shortcut which contains the command line
you want executed. Give that a double-click and it should also work.
If the redirector app
is run without arguments, it will open the Microsoft Store to install
the latest version of the Python store app distribution. Currently
that means Python 3.10.
Just double-clicking on the file will run it. The problem is that it will open a command shell, run, and then close the command shell UNLESS one explicitly codes some sort of "hold" at the end of the program
Eryk Sun wrote:
If the redirector app
is run without arguments, it will open the Microsoft Store to install
the latest version of the Python store app distribution. Currently
that means Python 3.10.
That is true with cmd. But with a shell like 4NT, I get:
c:\> "%LocalAppData%\Microsoft\WindowsApps\python.exe"
4NT: (Sys) No access to the file.
"C:\Users\gvane\AppData\Local\Microsoft\WindowsApps\python.exe"
No matter what I do with this "App Alias" setting.
What a broken and confusing design this AppX design is.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 54:32:56 |
Calls: | 6,650 |
Calls today: | 2 |
Files: | 12,200 |
Messages: | 5,330,627 |