Failed to Initialize Python Interpreter

866
1
01-12-2023 01:14 PM
by Anonymous User
Not applicable

I've been trying for a while now to write a python script to identify some water wells that are not located where they are supposed to be. I have a workflow that does the job, but doing it manually takes about four hours or so. I know I can write a script for it, but for the life of me I can't get the python interpreter to initialize.

I want to be able to click on the button to open the python window or to create a notebook and have it those things open up. But they don't. I know that my python environment needs to be pointed to the python.exe file. Apparently I have a few of those on my system. I've uninstalled all the python things on my computer (including ArcGIS Pro), and reinstalled the programs, and I still cannot access python stuff in ArcGIS Pro. Right now, my environment is set to C:\Program Files\ArcGIS\Pro\bin\Python\envs.

It doesn't work with that environment (the default environment after I reinstalled the program). And it doesn't work when I point it to the other python.exe locations either. Frankly, I don't know what I need to do at this point or who I can contact to help me get this thing figured out. Help?

Tags (1)
0 Kudos
1 Reply
AdamMesser1
New Contributor III

@Anonymous User  try clearing your registry keys using the Clean uninstall of ArcGIS Pro - Esri BeLux instructions to fix the path to your python install. If this is the problem you may not need to do a reinstall.

Failure behavior includes: Analysis -> python window - fails to initialize interpreter, arcgispro-py3 python environment cannot be cloned in package manager, running python command prompt from start-> arcgis returns "cannot find path" (our example was pointing to "C:\Users\****\AppData\Local”). However, if you navigate to your python install location you can start the python.exe and another user logging onto the machine can use python in Pro without errors.

The python command prompt runs the "C:\Program Files\ArcGIS\Pro\bin\Python\Scripts\proenv.bat" file running "C:\Program Files\ArcGIS\Pro\bin\PythonEnvUtils.exe" to retrieve the python environment from the registry. The environment is set in the PythonCondaRoot from either  Computer\HKEY_CURRENT_USER\SOFTWARE\Esri\ArcGISPro  or Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Esri\ArcGISPro . In our case a new machine based install had a conflict with the prior user based install for the conda root entry. Simply renaming the ArcGISPro folder under the CURRENT_USER registry fixed the issue. This does not require admin privileges. Make sure you do not have an offline license per the clean uninstall instructions.

Good luck!

0 Kudos