PROBLEM

Unable to execute a python file in Windows Command Prompt

Last Published: December 21, 2021

Description

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 error message

Cause

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
C:\Python27\ArcGIS10.x
  • Python 3.x for ArcGIS Enterprise 10.8.x and below
C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3
  • Python 3.x for ArcGIS Enterprise 10.9.x
C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\Scripts\propy.bat

Article ID:000026993

Software:
  • ArcGIS Server

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic