Unable to run GIS tools that access arcpy

788
2
02-27-2014 08:20 PM
HeatherWelch1
New Contributor II
Hello,

I've searched the discussion forums but have been unable to find a solution to my problem...
I recently installed a new version of GIS (10.2).  I had an old version of python (2.6) on my computer, and so the GIS installation included a new version of python (2.7, 32bit). I needed to install a new version of Marine Geospatial Ecology Tools (MGET), which requires python and pywin32 to run. The MGET installation found the two versions of python in the registry and kept failing to install properly, so I deleted all versions of python and pywin from my computer to start fresh (which I'm now thinking was a big mistake). I reinstalled python (2.7.6, 32bit) on my computer here: C:\Python27.

But now when I run a GIS tool that needs access to arcpy, say Raster Calculator, I get the following error:
ERROR 000539: Error running expression: rcexec()
Traceback (most recent call last):
File "<expression>", line 1, in <module>
File "<string>", line 2, in rcexec
File "c:\programe files (x86)\arcgis\desktop10.2\arcpy\arcpy\__init__.py", line 33, in <module>
   import arcpy.utils as utils
AttributeError: 'module' object has no attribute 'utils'

I'm thinking that GIS is not recognizing the new python version, or is missing a pathway.  I have a very basic understanding of how these two programs link together, but I've been trying to follow this thread http://forums.arcgis.com/threads/23230-quot-ImportError-No-module-named-arcpy-quot-PYTHON and I seem to have a similar problem.  I'm hoping to avoid having to remove all python and GIS programs from my computer and reinstall again...any help would be greatly appreciated. 

Some other info in case it's helpful:
-Only one version of python installed (2.7.6 32bit, C:\Python27)
-GIS is here: C:\Program Files (x86)\ArcGIS\Desktop10.2
-Also have these files
   C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy
   C:\Program Files (x86)\ArcGIS\Desktop10.2\bin
-Don't have this file
   C:\Python27\ArgGIS10.2

Apologies if I'm not providing the correct information...

Thanks,
Heather
Tags (2)
0 Kudos
2 Replies
JoshuaChisholm
Occasional Contributor III
Hello Heather,

I hate to be the bearer of bad news, but I think you might need to uninstall/re-install arcGIS. Part of the software suite is the python install located here: C:\Python27\ArgGIS10.2. In the future I would try to keep that install of python and not have any others.

You can confirm that your arcGIS python is missing by trying the following. Click Start > All Programs > ArcGIS > Python 2.7 > IDLE (Python GUI). If that opens, try import arcpy. If anything fails along the way (I suspect it will), you've probably lost your arcGIS copy of python.

I could only think of one last desperation move, but I'm not sure if it would work. If you have a friend/colleague with the same version of arcmap, you could try copying their directory (C:\Python27\ArgGIS10.2) into yours.

Good luck either way!
~Josh
0 Kudos
HeatherWelch1
New Contributor II
Hi Josh,

Thank you so much for your response, and sorry mine is so late (I've been out in the field and away from internet). As you suspected, import arcpy failed and I've had to reinstall GIS. Fixed the problem! Thanks for the help.

Cheers,
Heather