ArcPy RuntimeError: NotInitialized

191
1
Jump to solution
04-01-2024 07:19 PM
Labels (1)
JeffHouser
Occasional Contributor

I have created a stand-alone python script that I have been using for a few years.  However, there is one machine that is getting the following error that is attached as a jpg.  I did try a couple of recommended things from online searches, but it seemed not to help.  Maybe a community member have experienced something similar?  If so, can you let me know what the fix is?

Thank You

~Jeff

 

0 Kudos
1 Solution

Accepted Solutions
JeffHouser
Occasional Contributor

For a digital trail, below are solutions to the above issue: 

Issue was caused by the fact that the Python environment has not been initialized or configured correctly to execute the Python scripts containing ArcPy modules from ArcGIS Pro.
I was executing Python script from "..\Python27\ArcGIS10.8\" that is pointing to the Python interpreter (python.exe) that comes from the legacy ArcMap's 32-bit Python v2.7 installation,
which is incorrect when running ArcPy modules from ArcGIS Pro 3.2.2. ArcGIS Pro 3.2 comes bundled with a separate 64-bit Python 3.9.18 installation and this should be used when running ArcPy modules
from ArcGIS Pro in stand-alone Python scripts.

~Jeff

View solution in original post

0 Kudos
1 Reply
JeffHouser
Occasional Contributor

For a digital trail, below are solutions to the above issue: 

Issue was caused by the fact that the Python environment has not been initialized or configured correctly to execute the Python scripts containing ArcPy modules from ArcGIS Pro.
I was executing Python script from "..\Python27\ArcGIS10.8\" that is pointing to the Python interpreter (python.exe) that comes from the legacy ArcMap's 32-bit Python v2.7 installation,
which is incorrect when running ArcPy modules from ArcGIS Pro 3.2.2. ArcGIS Pro 3.2 comes bundled with a separate 64-bit Python 3.9.18 installation and this should be used when running ArcPy modules
from ArcGIS Pro in stand-alone Python scripts.

~Jeff

0 Kudos