For context this is ArcGIS 10.4.1 for Desktop using arcpy python 2.7 module.
So I have been working all day messing around with arcpy to modify some shapefiles I have with no issues at all. About an hour ago, I ran the same script as I had previously been running, but this time instead of ~20 seconds to import arcpy, it wouldn't even import after 30+ minutes. I've tried restarting my IDE (PyCharm) and debugging the import code.
What I found is that at the line below, the import hangs and nothing happens after this line is reached.
envset <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>set<SPAN class="punctuation token">(</SPAN>env <SPAN class="keyword token">for</SPAN> env <SPAN class="keyword token">in</SPAN> self<SPAN class="punctuation token">.</SPAN>_gp<SPAN class="punctuation token">.</SPAN>listEnvironments<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
In the _base.py file.
I'm not sure if this is an issue on ESRI's side with validation of my license, but this problem has persisted for over an hour so far for what seems like no reason. I made absolutely no changes to my development environment and this is the first issue with importing since I got it to work about a month ago.