Search code examples
python-3.xmsix

Cannot launch python via cmd


Currently I'm working on a project to deliver apps via MSIX packaging including python as one of them. I've already created an msix package for the same with below settings :

Python installation settings

So the MSIX package displays the environment variables added to the system path

Python MSIX package registry

VHD has been mounted (staged) and registered on test machine, however I still cannot open python via cmd

Cannot find python

I'm a bit new to the MSIX packaging tech, so any help would be appreciated.

Users to be able to run python from cmd.


Solution

  • Files that are packaged and deployed with an MSIX run inside a container. This means that these files will not be "visible" by default to tools like cmd or Powershell.

    You need to define an appExecutionAlias in your package manifest. The following SO question has more details:

    If you're using the MSIX Packaging Tool or Visual Studio to build the package, you need to manually edit the AppXManifest.xml file and add the appExecutionAlias element.

    If you're using other commercial tools, you probably have a GUI option to include and configure it.