Select to view content in your preferred language

Can't import Arcpy in 10.2

3606
4
08-15-2013 12:15 PM
AdamInglis
Deactivated User
What do I need to do be able to import Arcpy after upgrading to 10.2?

>>> import arcpy
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\__init__.py", line 21, in <module>
  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\geoprocessing\__init__.py", line 14, in <module>
  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 14, in <module>
ImportError: No module named arcgisscripting
Tags (2)
0 Kudos
4 Replies
MichaelVolz
Esteemed Contributor
That's all you should have to do.

Can you confirm that python 2.7 is installed at c:\python27\arcgis10.2?
0 Kudos
MikeMacRae
Frequent Contributor
Check your environmental variables are set properly. PYTHONPATH should be C:\Python27\ArcGIS10.2\Lib\site-packages
0 Kudos
ChrisSnyder
Honored Contributor
Recommended couse of action:

  1. Uninstall everything and anything ArcGIS

  2. Delete the folder C:\Program Files\ArcGIS (or C:\Program Files x86\ArcGIS if using a 64 bit OS)

  3. Uninstall everything and anything Python, including any Python IDEs like PythonWin

  4. Delete any and all Python2* folders that are directly under C:\ (example: C:\Python27).

  5. Reinstall ArcGIS v10.2 (which will automatically install the correct version of Python)

  6. Reinstall any 3rd party ArcGIS software (like Xtools or whatever). You remebered to uninstall these in Step #1, right?

  7. Reinstall your Python IDEs if any.



  • Use this same process eveytime you upgrade ArcGIS (don't need to do that for the service packs of course).

  • DO NOT use/install a different version of Python than that which comes with whatever version of ArcGIS you are using

0 Kudos
AdamInglis
Deactivated User
Check your environmental variables are set properly. PYTHONPATH should be C:\Python27\ArcGIS10.2\Lib\site-packages


Thanks, that help with python, but not with PythonWin.  Halfway there.
0 Kudos