Problem: Unable to execute a python file in Windows Command Prompt
Attempts to execute a python file in Windows Command Prompt fail, and the following error message is returned:
Error: This app can't run on your PC. To find a version for your PC, check with the software publisher.
The python.exe file is corrupted, as it has a file size of 0kb. Windows executable files cannot be 0kb in size.
Solution or Workaround
Download and reinstall the python.exe file. The necessary Python version is listed in the knowledge base article, FAQ: What version of Python is used in ArcGIS?, and the python.exe file can be downloaded from Python: Download the latest version. The default location for the python.exe file depends on the version, as demonstrated below.
- Python 2.7
- Python 3.x for ArcGIS Enterprise 10.8.x and below
- Python 3.x for ArcGIS Enterprise 10.9.x
Last Published: 12/20/2021
Article ID: 000026993
Software: ArcGIS Server 10.9.1, 10.9, 10.8.1, 10.8, 10.7.1, 10.7