PROBLEM
When importing ArcPy in ArcGIS Pro, one of the following errors is returned:
Error: ImportError: DLL load failed: %1 is not a valid Win32 application.
Error: ModuleNotFoundError: No module named ‘arcpy’
Error: ImportError: No module named arcpy
Error: RuntimeError: NotInitialized
Error: ImportError: DLL load failed: The specified module could not be found.
Error: ImportError: DLL load failed: The specified procedure could not be found.
Depending on the cause, follow one of the workarounds below to resolve the issue.
Get an exact copy of the Python environment to allow switching between sets of Python functionality without uninstalling and reinstalling packages each time. Refer to ArcGIS Pro: Clone an environment or How To: Clone a Python environment with the Python Command Prompt for instructions.
Note: Ensure the Path, PYTHON, or PYTHONPATH environment variable is correctly set. Refer to How To: Edit an environment variable and Error: ImportError: DLL load failed: %1 is not a valid Win32 application for more information.
Ensure the NumPy version is compatible with the ArcPy version installed in ArcGIS Pro. Refer to FAQ: What version of Python is used in ArcGIS? for more information. Download the appropriate version by referring to NumPy: Installing NumPy.
Run the script using IDLE instead of a third-party Python interpreter. Refer to ArcGIS Pro: Python IDEs for more information on IDLE.
Update ArcGIS Pro to the latest version. Refer to ArcGIS Pro: Update ArcGIS Pro for further instructions.
Install the latest version of the Python software to update to the latest IDLE version. Refer to Python: Python Releases for Windows for more information.
Refer to FAQ: How do I troubleshoot ArcGIS Pro performance issues related to antivirus software (exceptions)? for more information.
Remove the files and registry keys of ArcGIS Pro to fully uninstall the software from the system and reinstall ArcGIS Pro. Refer to How To: Perform a clean uninstall and reinstall of ArcGIS Pro for further instructions.
Get help from ArcGIS experts
Download the Esri Support App