Windows Store Download For Windows 8.1

0 views
Skip to first unread message

Gordon Neal

unread,
Aug 4, 2024, 2:24:21 PM8/4/24
to geartfambtructel
Andwhen I type Python in CMD, it opens the Windows Store for me to download Python 3.7. This problem started today for no good reason. I didn't change or download anything about Python and already tried reinstalling Python, and the Path environment variable is correct.

Use the Windows search bar to find "Manage app execution aliases". There should be two aliases for Python. Unselect them, and this will allow the usual Python aliases "python" and "python3". See the image below.


I think we have this problem when installing Python because in a new Windows installation the aliases are in the ON position as in image below. When turned on, Windows puts an empty or fake file named python.exe and python3.exe in the directory named %USERPROFILE%\AppData\Local\Microsoft\WindowsApps. This is the alias.


When you enter "python" in cmd, it searches the directories listed in your "Path" environment variables page from top to bottom. So if you installed Python after a new Windows 10 install then get redirected to the Windows Store, it's because there are two python.exe's: The alias in the App Execution Alias page, and the real one wherever you installed Python. But cmd finds the App execution, alias python.exe, first because that directory is at the top of the Path.


The first time I ran into this problem, I manually deleted the python.exe and python3.exe files but when I restarted the files regenerated. That prompted me to search for the App Execution Aliases page and uncheck the box, which solved it for me, by not allowing the files to regenerate.


Based on this Microsoft Devblog, they stated they created this system partially for new Python users, specifically kids learning Python in school that had trouble installing it, and focus on learning to code. I think Windows probably deletes those aliases if you install Python from the Windows App Store. We are noticing that they do not get deleted if you manually install from another source.


(Also, the empty/fake python.exe is not really empty. It says 0 KB in the screenshot, but entering "start ms-windows-store:" in cmd opens the Windows App Store, so it probably just has a line with that and a way to direct it to the Python page.)


Another alternative is to delete the user path environment variable that points to the alias files, %USERPROFILE%\AppData\Local\Microsoft\WindowsApps, but the App Execution Aliases handle more apps than just python, and deleting the path from environment variables breaks all the other apps that have execution aliases in that directory; which on my PC includes notepad, xbox game bar, spotify, monitoring software for my motherboard, paint, windows subsystem for android, to name a few. Also if you think about it, the average Windows user is unfamiliar editing environment variables and on school and business owned computers requires administrative access. So deleting the path to ...\WindowsApps, from the path environment variable, is not ideal.


The main problem here is that the order in the path calls the windows from top to bottom, and that there is python.exe in %USERPROFILE%\AppData\Local\Microsoft\WindowsApps which is called first if there are no other python.exes in the PATH above that line.


Solution: I tried deleting the python*.exe files in the WindowsApp directory, but Windows wouldn't allow it, so I opened a command prompt in the "%USERPROFILE%\AppData\Local\Microsoft\WindowsApps" directory and typed:


A convergence of two things: the previous introduction of the Python Launcher for Windows in 2011 (hereafter py), and a Windows 10 update in May 2019 that was apparently intended to make installing Python easier for Windows users.


Oops. Turns out that installation path isn't great; it bypasses the "lengthy" setup wizard... which contains some options that some users find very useful. It caused other issues, too. Not to mention that it just works in slightly non-standard ways, has limitations on file system access because it's a Store app, initially couldn't itself be launched by py....


Since the introduction of py, by default, Windows Python installers do not add the new Python install to the PATH. Why? Because the entire point of py is that it uses its own logic to find a Python installation, based on some combination of command-line switches and possibly the source file's own shebang line. Now your source files can be associated with py instead of any particular python.exe, and you can get Linux-like behaviour when double-clicking a file. Meanwhile, by running py at the command line, you have easy access to whatever you need, and you don't have to think about which version of Python was installed most recently. So there's seemingly no good reason to put any of those Python installations on the PATH. It only risks confusing you when, for example, the most recently installed version isn't the most up-to-date one. Right?


In the update, Windows 10 put a "python.exe" into a Windows Apps-related folder, which is a wrapper app to open a Microsoft Store link. The idea is that it's on the PATH, but way near the end; so if you have an installed Python, it gets used, and otherwise the wrapper is invoked and helpfully prompts you to install Python - so that you can actually run that random, totally trusted .py file your friend sent you on Discord.


(But, you know, py had been introduced around 8 years prior. You'd think someone at Microsoft would have been aware of the potential issue. Maybe instead of a special shortcut link, they could have made an actual script that checks for the presence of C:\Windows\py.exe or something.)


You can check the option to add new Python versions to the PATH when you install them, and deal with the fact that python at the command line means a specific one of them. If you need to change that, you can manually tweak your PATH variable.


Independently of that, you can disable the wrappers, as shown in the top answer. You should probably do this anyway; seeing python fail at the command line is less aggravating than dealing with a random GUI window popping up and offering to install something for you, especially when you know you have it already.


If you want to keep the PATH empty, consider using virtual environments for your projects. Whenever a virtual environment is active, the PATH is temporarily modified such that python means the Python installation of that environment. It's quite convenient, really.


As a person who does Python development in Sublime Text, I know you said the Python interpreter path was correct, but when you install the Python interpreter make sure to tick the option to add Python to PATH.


Aha, there is a sneaky python.exe deep inside another program's folder, this is my unique software conflations situation, and cr5000 is in system PATH, I can't make the user PATH take precedence over the system, so I have to add an python3 alias with symbolic link.


Py is an alias useful for other tasks if you have seveal versions of python. So the app execution aliases button unchecking is not recommended. The "new" way to find out the python version installed is typing in CMD


With Windows 10, the good old win32 executable got a new sibling: The UniversalWindows Platform. The new .appx format does not only enable a number of newpowerful APIs like Cortana or Push Notifications, but through the Windows Store,also simplifies installation and updating.


Microsoft developed a tool that compiles Electron apps as .appx packages,enabling developers to use some of the goodies found in the new applicationmodel. This guide explains how to use it - and what the capabilities andlimitations of an Electron AppX package are.


Windows 10 "Anniversary Update" is able to run win32 .exe binaries bylaunching them together with a virtualized filesystem and registry. Both arecreated during compilation by running app and installer inside a WindowsContainer, allowing Windows to identify exactly which modifications to theoperating system are done during installation. Pairing the executable with avirtual filesystem and a virtual registry allows Windows to enable one-clickinstallation and uninstallation.


In addition, the exe is launched inside the appx model - meaning that it can usemany of the APIs available to the Universal Windows Platform. To gain even morecapabilities, an Electron app can pair up with an invisible UWP background tasklaunched together with the exe - sort of launched as a sidekick to run tasksin the background, receive push notifications, or to communicate with other UWPapplications.


Package the application using @electron/packager (or a similar tool).Make sure to remove node_modules that you don't need in your final application, sinceany module you don't actually need will increase your application's size.


From an elevated PowerShell (run it "as Administrator"), runelectron-windows-store with the required parameters, passing both the inputand output directories, the app's name and version, and confirmation thatnode_modules should be flattened.


Once executed, the tool goes to work: It accepts your Electron app as an input,flattening the node_modules. Then, it archives your application as app.zip.Using an installer and a Windows Container, the tool creates an "expanded" AppXpackage - including the Windows Application Manifest (AppXManifest.xml) aswell as the virtual file system and the virtual registry inside your outputfolder.


Once the expanded AppX files are created, the tool uses the Windows App Packager(MakeAppx.exe) to create a single-file AppX package from those files on disk.Finally, the tool can be used to create a trusted certificate on your computerto sign the new AppX package. With the signed AppX package, the CLI can alsoautomatically install the package on your machine.


In opposition to traditional UWP apps, packaged apps currently need to undergo amanual verification process, for which you can apply here.In the meantime, all users will be able to install your package by double-clicking it,so a submission to the store might not be necessary if you're looking for aneasier installation method. In managed environments (usually enterprises), theAdd-AppxPackage PowerShell Cmdlet can be used to install it in an automated fashion.

3a8082e126
Reply all
Reply to author
Forward
0 new messages