1

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?

5
  • 1
    generally, for a quick module check, I just type idle in the start menu search bar and then try import arcpy when idle opens.
    – mr.adam
    Commented May 20, 2015 at 15:46
  • @mr.adam Keep in mind, IDLE is a separate installation itself.
    – juturna
    Commented May 20, 2015 at 15:48
  • well, it's a separate program, but doesn't it always come packaged with python on windows?
    – mr.adam
    Commented May 20, 2015 at 15:54
  • 2
    This question sounds more like "how come arcpy is broken, or doesn't work?", not "is it installed?"
    – KHibma
    Commented May 20, 2015 at 15:59
  • @KHibma unless Python and Arcpy are automatically installed with every install and it is impossible to unstall or prevent this from happening, I don't think we can assume it is installed. Once I verify it is installed, I may be asking why it's broken. Commented May 20, 2015 at 16:02

1 Answer 1

2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.