<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: import arcpy hangs in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/import-arcpy-hangs/m-p/481506#M37668</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I got some help from Stack Exchange ( &lt;A href="http://gis.stackexchange.com/questions/5207/why-would-import-arcpy-hang-python-script-run-from-dos-cmd-prompt" rel="nofollow noopener noreferrer" target="_blank"&gt;http://gis.stackexchange.com/questions/5207/why-would-import-arcpy-hang-python-script-run-from-dos-cmd-prompt&lt;/A&gt; ) that has helped me get this working on one Vista laptop but not another.&amp;nbsp; I'm still hoping someone may come up with a (better) solution that works on both my laptops.&lt;BR /&gt;&lt;BR /&gt;- Graeme&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also have this problem. I have compared behaviour across two different installations: both windows server 2008 R2 / ArcGIS server 10.1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have pythonwin installed on both, and can run non-arcpy scripts without problems. On one machine, the following snippet ....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
print "Starting"
import os
print "OS imported"
import arcpy
print "ArcPy imported"
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;... runs from start to end and returns exit code 0. On the other, it hangs, pythonwin enters a "Not Responding" state, and I am forced to restart the application. If I comment out the:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;line, the script runs from start to end on both machines, returning exit code 0;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not getting much back in the way of diagnostics - no error messages, just an application hang, so struggling to find a way forward. I doubt this is due to paths, since the behaviour is a hang, rather than the error that I would expect to see if the arcpy library could not be located. The sys.path includes&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
'C:\\Program Files (x86)\\ArcGIS\\Desktop10.1\\arcpy'
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;on both machines, which is a valid directory path in both cases.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd appreciate any advice on how to further diagnose this problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:14:59 GMT</pubDate>
    <dc:creator>DavidMountain</dc:creator>
    <dc:date>2021-12-11T21:14:59Z</dc:date>
    <item>
      <title>import arcpy hangs</title>
      <link>https://community.esri.com/t5/python-questions/import-arcpy-hangs/m-p/481503#M37665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a very small test script (test.py) that I use to see if Python is installed and ready to use ArcPy. All it contains is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;print "Starting"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import os&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print "OS imported"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print "ArcPy imported"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I�??m running it under Vista SP1 with ArcGIS Desktop 10 SP1 and the only version of Python present is 2.6.5 which was installed by ArcGIS Desktop 10.&amp;nbsp; ArcMap 10 SP1 is starting fine and the "import arcpy" and other arcpy functions work fine from the Python Window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, when I run �??python test.py�?� from the DOS/cmd prompt, the first two print statements execute as expected, but the last one does not, so it seems to be failing/hanging on �??import arcpy�?�.&amp;nbsp; For a brief time on two separate days the script actually ran fine, but then it seems to stop working (which to me is bizarre).&amp;nbsp; To try and figure what the problem is I have been reading �??Importing ArcPy�?� at &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z00000008000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z00000008000000.htm&lt;/A&gt;&lt;SPAN&gt; and I think I have the system variables Path and PYTHONPATH set to appropriate values:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Path=C:\Program Files\weoapp;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;c:\Program Files\Common Files\Lenovo;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files\ThinkPad\ConnectUtilities\;C:\Program Files\Lenovo\Client Security Solution;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\QuickTime\QTSystem;C:\Program Files\Windows Live\Shared;C:\Program Files\QuickTime\QTSystem\;C:\Python26\ArcGIS10.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PYTHONPATH=C:\Python26\ArcGIS10.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but I�??ve also tried:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PYTHONPATH=C:\Python26&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I first noticed the problem I had both Python 2.5.x (C:\Python25) and 2.6.5 (C:\Python26) present, so I went to considerable trouble to remove both, and uninstall ArcGIS Desktop 10 SP1 before reinstalling ArcGIS Desktop 10 (which installed Python 2.6.5) and then its SP1 again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have an idea as to what may be causing �??import arcpy�?� to hang for me most of the time, or have any ideas as to what debugging steps may be available to me?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Graeme&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jan 2011 01:05:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-arcpy-hangs/m-p/481503#M37665</guid>
      <dc:creator>GraemeBrowning</dc:creator>
      <dc:date>2011-01-17T01:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: import arcpy hangs</title>
      <link>https://community.esri.com/t5/python-questions/import-arcpy-hangs/m-p/481504#M37666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you ever resolve this issue?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I just started having this happen on a computer that previously worked fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Charles&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jan 2011 23:35:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-arcpy-hangs/m-p/481504#M37666</guid>
      <dc:creator>CharlesMorton</dc:creator>
      <dc:date>2011-01-24T23:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: import arcpy hangs</title>
      <link>https://community.esri.com/t5/python-questions/import-arcpy-hangs/m-p/481505#M37667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I got some help from Stack Exchange ( &lt;/SPAN&gt;&lt;A href="http://gis.stackexchange.com/questions/5207/why-would-import-arcpy-hang-python-script-run-from-dos-cmd-prompt"&gt;http://gis.stackexchange.com/questions/5207/why-would-import-arcpy-hang-python-script-run-from-dos-cmd-prompt&lt;/A&gt;&lt;SPAN&gt; ) that has helped me get this working on one Vista laptop but not another.&amp;nbsp; I'm still hoping someone may come up with a (better) solution that works on both my laptops.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Graeme&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 07:23:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-arcpy-hangs/m-p/481505#M37667</guid>
      <dc:creator>GraemeBrowning</dc:creator>
      <dc:date>2011-01-25T07:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: import arcpy hangs</title>
      <link>https://community.esri.com/t5/python-questions/import-arcpy-hangs/m-p/481506#M37668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I got some help from Stack Exchange ( &lt;A href="http://gis.stackexchange.com/questions/5207/why-would-import-arcpy-hang-python-script-run-from-dos-cmd-prompt" rel="nofollow noopener noreferrer" target="_blank"&gt;http://gis.stackexchange.com/questions/5207/why-would-import-arcpy-hang-python-script-run-from-dos-cmd-prompt&lt;/A&gt; ) that has helped me get this working on one Vista laptop but not another.&amp;nbsp; I'm still hoping someone may come up with a (better) solution that works on both my laptops.&lt;BR /&gt;&lt;BR /&gt;- Graeme&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also have this problem. I have compared behaviour across two different installations: both windows server 2008 R2 / ArcGIS server 10.1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have pythonwin installed on both, and can run non-arcpy scripts without problems. On one machine, the following snippet ....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
print "Starting"
import os
print "OS imported"
import arcpy
print "ArcPy imported"
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;... runs from start to end and returns exit code 0. On the other, it hangs, pythonwin enters a "Not Responding" state, and I am forced to restart the application. If I comment out the:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;line, the script runs from start to end on both machines, returning exit code 0;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not getting much back in the way of diagnostics - no error messages, just an application hang, so struggling to find a way forward. I doubt this is due to paths, since the behaviour is a hang, rather than the error that I would expect to see if the arcpy library could not be located. The sys.path includes&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
'C:\\Program Files (x86)\\ArcGIS\\Desktop10.1\\arcpy'
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;on both machines, which is a valid directory path in both cases.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd appreciate any advice on how to further diagnose this problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:14:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-arcpy-hangs/m-p/481506#M37668</guid>
      <dc:creator>DavidMountain</dc:creator>
      <dc:date>2021-12-11T21:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: import arcpy hangs</title>
      <link>https://community.esri.com/t5/python-questions/import-arcpy-hangs/m-p/481507#M37669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #242729; background-color: rgba(248, 248, 248, 0.6);"&gt;We had this issue and it was our Anti Virus software causing it to hang.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2017 19:11:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-arcpy-hangs/m-p/481507#M37669</guid>
      <dc:creator>Drew</dc:creator>
      <dc:date>2017-05-09T19:11:54Z</dc:date>
    </item>
  </channel>
</rss>

