ERROR

ImportError: DLL load failed: %1 is not a valid Win32 application

Last Published: April 25, 2020

Error Message

When attempting to import ArcPy into ArcGIS Pro, the import statement returns the following error message:

Error:   
ImportError: DLL load failed: %1 is not a valid Win32 application.
Error message

Cause

The ArcGIS Pro 64-bit Python interpreter is attempting to import a 32-bit module, as the Environment Variable 'PYTHON' or 'PYTHONPATH' is referencing a folder containing the ArcMap 32-bit ArcPy module.

Solution or Workaround

  1. Run the following script in the ArcGIS Pro Python interpreter:
import sys
for path in sys.path:
	print (path)
Note:
The script loops through each path the Python interpreter references for modules. If the generated lists include  the ArcMap 32-bit ArcPy module, move to Step 2. 
  1. Navigate to Control Panel > System > Advanced system settings > Environment Variables. The Environment Variables 'PYTHON' or 'PYTHONPATH' is defined here.
Environment Variables window
  1. Select the 'PYTHON' or 'PYTHONPATH' variable and click Edit.... This opens the Edit System Variable window.
  2. Change the Variable value to C:\Program Files\ArcGIS\Pro\bin\Python. Click OK.
  3. Restart the machine.

Article ID:000019997

Software:
  • ArcGIS Desktop 1

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic