Frequently asked question

Why does Python crash when importing arcpy from the Command Prompt?

Last Published: April 25, 2020

Answer

After upgrading from ArcGIS Pro 2.3 to 2.4, an issue has been reported where Python crashes when importing arcpy into the Command Prompt (cmd.exe). This happens in the Command Prompt, but works as expected in ArcGIS Pro. The issue occurs when arcpy is imported from ArcGIS Pro's installation of Python3.

When Python crashes, a dump file is generated in this location:

C:\Users\USERNAME\AppData\Local\CrashDumps

The dump file related to this particular issue should look similar to that shown in the following image:

image of dump file

ArcGIS Pro's installation of Python 3 is dependent on various packages including OpenSSL. When arcpy is imported, many of these dependent files are loaded. One of these dependencies is a .dll file called libcrypto-1_1-x64.dll. Python crashes because an older version of the libcrypto-1_1-x64.dll file is loaded from the system32 folder and not from ArcGIS Pro's installation folder.

The libcrypto-1_1-x64.dll file (and other OpenSSL Library files and non-Microsoft libraries) should not exist in the System32 folder. The above dll in the system32 folder has not been created by any Esri software installation including ArcGIS Pro. When ArcGIS Pro is installed this file is put into the default location:

C:\Program Files\ArcGIS\Pro\bin

One possible solution to resolve the Python crash is to go into the System32 folder and then rename the libcrypto-1_1-x64.dll file. This is a possible solution but Esri cannot guarantee the consequences, as some other software may be using this particular DLL file from this location. 

Warning:
Consult a qualified computer systems professional, if necessary. Esri cannot guarantee results from incorrect modifications while following these instructions. Therefore, use caution and proceed at your own risk.

Please refer to the following GitHub page that goes over the existence of these unexpected OpenSSL files in the System32 folder: 
Unexpected OpenSSL dll files in C:\Windows\System32 #2571

Article ID:000022475

Software:
  • ArcGIS Pro 2 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options