Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Trying to do anything in the Python shell within ArcGIS 10.2 and it just crashes once I hit enter after writing code, no matter what I do. I've tried to uninstall, deauthorize, reinstall, re-authorize, hoping it would repair, but it still crashes.

On a similar note (not sure if they're connected), I can not import arcpy outside of ArcGIS, whether it's in the 2.7.3 shell or WING IDE. It prompts that:

raise TypeError("This object does not support enumeration")

TypeError: This object does not support enumeration

I don't understand any of this, I've always had an issue trying to import arcpy, I don't get it. I thought it was as simple as updating the Python paths to the arcpy library. Any help or suggestions?

Here's the result of sys.path:

['', 'c:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy', 'C:\', 'c:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\gdal', 'C:\WINDOWS\SYSTEM32\python27.zip', 'c:\Python27\ArcGIS10.2\DLLs', 'c:\Python27\ArcGIS10.2\lib', 'c:\Python27\ArcGIS10.2\lib\plat-win', 'c:\Python27\ArcGIS10.2\lib\lib-tk', 'c:\Python27\ArcGIS10.2', 'c:\Python27\ArcGIS10.2\lib\site-packages', 'C:\Program Files (x86)\ArcGIS\Desktop10.2\bin', 'C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Scripts', 'c:\Python27\ArcGIS10.2\lib\site-packages\win32', 'c:\Python27\ArcGIS10.2\lib\site-packages\win32\lib', 'c:\Python27\ArcGIS10.2\lib\site-packages\Pythonwin']

share|improve this question
1  
Not being able to import arcpy should give an error stating that there is no module named arcpy. The error you describe sounds like an error in the code itself. Do you get the error if you simply run a script that only does import arcpy? –  papadoo Aug 17 at 21:52
1  
Have you got multiple installs of python? –  Michael Miles-Stimson Aug 17 at 21:59
    
I used to get the 'no module named arcpy' error, but sifting through stack exchange for help, I proceeded to install PythonWin, Win32, etc and it progressed to the error above. –  Dave Aug 17 at 22:48
    
@ Michael Miles-Stimson, as far as I know, the only Python I have is the one that came with ArcGIS 10.2 –  Dave Aug 17 at 22:49
1  
Certainly sounds like competing installations - similar to this post. What version does it state when you start python from a command prompt? –  fluidmotion Aug 18 at 0:02

2 Answers 2

As @PolyGeo states un- and re-installing ArcGIS (and Python) is the solution, but you should do a COMPLETE uninstall of the software before reinstalling it. To do so follow these steps:

  • Uninstall any third-party extension for ArcGIS (like ET Geowizard or Xtools) via Add/Remove Program

  • Uninstall all ArcGIS/Esri programs via Add/Remove Program

  • Uninstall all Python programs via Add/Remove Program

  • Delete the ESRI folder in C:\Users\UserName\AppData\Roaming

  • Go to Start > Run, type regedit and press the Enter Key

    • Delete the ESRI Folder in HKEY_CURRENT_USER > Software

    • Delete the ESRI Folder in HKEY_LOCAL_MACHINE > Software

  • Delete the ESRI Folder in C:\Program Files\Common Files

  • Delete the ArcGIS Folder in C:\Program Files

  • Delete the Python27 folder in C:\

  • Reinstall ArcGIS: Run as Administrator and Choose "Complete" installation. (Python will install automatically)

share|improve this answer
    
thanks! I will try that and re-post. –  Dave Aug 19 at 1:31
    
I followed the steps as such and I can now use the Python window in Arc without it crashing, I can import Arcpy within Arc, and I can import arcpy module in the Python GUI! Thank you so much! –  Dave Aug 21 at 23:10
    
Glad I could help! Don't forget to mark the answer as solved. This is a classic issue so others might be happy to find a solution for it. –  GISGe Aug 22 at 6:20
    
I don't see where you're supposed to close the question or mark the answer as solved? –  Dave Aug 25 at 1:40
    
Under the answer's vote count, you should be able to click a check mark to mark it as accepted –  GISGe Aug 25 at 6:57

I find problems with symptoms similar to these are usually (almost invariably) resolved by an uninstall of ArcGIS for Desktop (and all Python versions) and then re-installing ArcGIS for Desktop (with its supported Python install).

However, it sounds like you have already done this.

Consequently, I recommend that you report this issue to your local Esri Support.

share|improve this answer
    
The only difference reinstalling Arc made was that instead of crashing directly on opening the Python window, it now opens the window and when you hit enter to execute, then it crashes. –  Dave Aug 17 at 22:50
1  
@Dave you mention WING IDE in your original post was that also removed before you did a clean install of ArcGIS? –  Dan Patterson Aug 17 at 22:53
    
@DanPatterson it was not. I figured since it's just a debugger that needs Python to work. So when I uninstalled Arc, I didn't think it would have an effect. I will uninstall it before reinstalling Arc, just to try. Thanks! –  Dave Aug 19 at 1:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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