3

I'm trying to get arcpy to work in Pycharm. I've done this successfully in the past. However, now when I try to do anything involving arcpy in Pycharm, the program runs then hangs forever. I have it down to a simple print statement. When I import arcpy it prints but hangs. When I remove arcpy it prints and exits. Any ideas? I just reinstalled both arc and pycharm. I don't think it would have anything to do with the fact I'm using arcgis 10.4?

import arcpy
print 'why is this not exiting?'
1
  • Do you have multiple versions of Python installed? Perhaps there is a problem with your system paths, and it can't find arcpy?
    – dslamb
    May 16, 2016 at 12:47

2 Answers 2

1

The reason for this is that the debugger has put a lock on ArcCatalog.gx. Here is a fix which would save your roaming profile.

  1. Close ArcGIS Desktop
  2. Close Python IDE
  3. Go to C:\users\\ Roaming
  4. Rename ESRI folder to ESRI_Keep
  5. Reopen Python IDE
  6. Run python debugger

This will create a new ESRI folder.

  1. Close Python IDE
  2. Delete C:\users\\ Roaming\ESRI
  3. Rename ESRI_Keep folder to ESRI
1

Found a solution for my problem: When debugging the import of arcpy with stepping in the import process, I found that the import of the Toolboxes of some extensions hanged. In my case, these were the extensions AGD data reviewer and AGD workflow manager. After deinstalling these extensions, arcpy could be imported (e.g. in Idle for Python 2.7.5). These are the only extensions which had separate Installers in my case

Remark:

  • I've done lot of empirical problem solving before (removing Normal.txt, removing ArcMap folder in Roaming Profile, installing and Reinstalling AGD,..). So I don't know exactly if all of this is necessary
  • my Environment: windows 7, ArcMap 10.2.2
  • I do not understand why this happens now because I did not update any ArcGIS Desktop software

Your Answer

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

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