1

I have arcgis 10.3 and I am trying to run a task using python but the python window within arcmap won't import arcpy. This never happened to me with 10.2.2. The error returned is:

Runtime error 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\__init__.py", line 24, in <module>
    from arcpy.toolbox import *
  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\toolbox.py", line 15, in <module>
    from .ddd import ASCII3DToFeatureClass as ASCII3DToFeatureClass_3d
  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\ddd.py", line 23, in <module>
    from arcpy.arcobjects.arcobjectconversion import convertArcObjectToPythonObject
  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\arcobjects\__init__.py", line 19, in <module>
    arcobjectconversion.initialize_conversion_mapping()
  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\arcobjects\arcobjectconversion.py", line 26, in initialize_conversion_mapping
    from .._mapping import MapDocument, PageLayout, DataFrame, DataFrameTime, DataDrivenPages, \
  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\_mapping.py", line 19, in <module>
    from arcpy.utils import logcall, ArgAdaptor
  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\utils.py", line 17, in <module>
    import inspect
ImportError: No module named inspect
4

If I was receiving this error then I would suspect a corrupt installation.

The expedient to resolving it, especially on a weekend, may be to uninstall ArcGIS for Desktop, remove any traces of Python from your machine, and then reinstall ArcGIS for Desktop which should reinstall Python cleanly.

2

I had this exact issue - I renamed the folder "C:\Python27" to "C:\Python27_old" and then repaired the ArcGIS Desktop installation from Control Panel, Programs and Features (Win7); highlighting "ArcGIS 10.3.1 for Desktop", and then Clicking "Install/Change" and selecting "Repair". Worked for me, and faster than reinstalling everything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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