import arcpy freezes python, restart fixes momentarily

1117
2
Jump to solution
07-09-2017 05:02 PM
BenVan_Kesteren1
Occasional Contributor III

Hey All, 

I have multiple python scripts that work on my SDE. Has been working well for some time. 

Just recently I have noticed that if I import arcpy in one python console, it works great, but if I then try to import arcpy again in another window or another script, it just hangs, not throwing any errors.

The only way I can get my machine to run any import arcpy again is to reboot completely.

I am running Python 2.7.12 from C:\Python27\ArcGIS10.3

Anyone else seeing arcpy play up like this?

Cheers

0 Kudos
1 Solution

Accepted Solutions
BenVan_Kesteren1
Occasional Contributor III

Hi Dan, you are correct on most fronts...  since I posted this morning I bit the bullet and upgraded from 10.3 to 10.5, which has indeed fixed my issue. 

I was using pycharm, but I then went bare basics by running python.exe, which had the same issue. I narrowed it down to the arcpy module, and it was only on this PC, not my other backup machine, so I thought a repair was in order, and like I said, I did the upgrade instead of a simple repair. 

All seems to be working now, but I do thank you for your comments and time in replying to my question.

View solution in original post

2 Replies
DanPatterson_Retired
MVP Emeritus

Can you confirm that you are trying to use more than one IDE? And which ones are they?  (I found Pycharm a drain for some reason.  Pythonwin is clean as are IPython and Spyder IDEs... 

I use several python IDE's all the time and have no issue importing arcpy in any.

Here is what may differ from your situation to see if you can narrow it down

I use 

  • windows 10 fully updated
  • I do not access the same script in any of the IDEs
  • I use window 3.5.x with ArcGIS PRO 2.0,...  2.7.12 with ArcMap 10.5.2... but I also use 3.5.x with ArcMap as well
  • I never use Arc*'s builtin python IDE
  • I have tons of ram in the computer and on my video cards.
  • I always use foreground geoprocessing 

I suspect you are going to say that you are working on a memory and video starved laptop.  If it is not a laptop, and using you are using arcmap, you are limited to 4 Gb of ram and everything else that you run will steal any ram above that and when that runs out, it will eat into the 4 Gb, often leaving you memory starved (you may see your hard drive light flashing wildly showing caching to disk during processing.

Anymore details might get some other opinions and things to check on to hopefully rectify your situation.

BenVan_Kesteren1
Occasional Contributor III

Hi Dan, you are correct on most fronts...  since I posted this morning I bit the bullet and upgraded from 10.3 to 10.5, which has indeed fixed my issue. 

I was using pycharm, but I then went bare basics by running python.exe, which had the same issue. I narrowed it down to the arcpy module, and it was only on this PC, not my other backup machine, so I thought a repair was in order, and like I said, I did the upgrade instead of a simple repair. 

All seems to be working now, but I do thank you for your comments and time in replying to my question.