[GIS] How to tell if arcpy is installed

arcgis-10.2arcpy

I have a user that recently received a new machine with a fresh install of 10.2. We have a python / arcpy application that worked in 10.1 on the old machine but does not work on the new machine with 10.2. The error message is "ImportError: No module named arcpy".

How do I determine if arcpy is installed on the machine? If it is installed, could this be a problem with the version?

Best Answer

One way to tell if arcpy is installed is to go into Add/Remove Programs, select ArcGIS 10.2 for Desktop, and click the Uninstall/Change.

When the ESRI window opens, select Modify and then click Next, and on the following screen Python should not have a red X on it. If it does have a red X, then you can change it to install the feature.


Another way to tell if arcpy is installed is to go into the following directory:

C:\Python27

And there should be an ArcGIS10.2 folder. Go into that folder and open the python.exe and type import arcpy

If it imports fine, then most likely your Environment Variables are messed up. You need to make sure the following paths are listed at the front of the Path variable:

C:\Python27\ArcGIS10.2;C:\Python27\ArcGIS10.2\Scripts;C:\Python27\ArcGIS10.2\Lib;

Otherwise, a different Python version may be acting as the default.


Also, there should be a file in:

C:\Python27\ArcGIS10.2\Lib\site-packages

Called desktop10.2.pth that simply contains the following text:

C:\Program Files (x86)\ArcGIS\Desktop10.2\bin
C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy
C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Scripts