<?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: Importing arcpy error in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259083#M8889</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have had the same problem, both in the office and &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;at a ESRI python course on ESRI PCs.&lt;/SPAN&gt;&lt;SPAN&gt; It seems to be an issue with compatibility between pywin and arcpy. I have since switched to &lt;/SPAN&gt;&lt;A href="https://code.google.com/p/pyscripter/"&gt;pyscripter&lt;/A&gt;&lt;SPAN&gt; and haven't switched back.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 May 2013 10:23:52 GMT</pubDate>
    <dc:creator>MennoNijhuis1</dc:creator>
    <dc:date>2013-05-03T10:23:52Z</dc:date>
    <item>
      <title>Importing arcpy error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259078#M8884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;when I try and import the arcpy module into python win I get this error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "&amp;lt;interactive input&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\__init__.py", line 17, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from geoprocessing import gp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\__init__.py", line 14, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from _base import *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 563, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; env = GPEnvironments(gp)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 560, in GPEnvironments&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return GPEnvironment(geoprocessor)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 506, in __init__&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self._refresh()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 508, in _refresh&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; envset = (set(env for env in self._gp.listEnvironments()))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: NotInitialized&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just instaled the python win 2.6 version after I installed the 10 pre-release.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 14:10:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259078#M8884</guid>
      <dc:creator>BrianGustafson</dc:creator>
      <dc:date>2010-04-08T14:10:40Z</dc:date>
    </item>
    <item>
      <title>Move the pth to the standard location</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259079#M8885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ArcGIS 10 puts its own copy of Python26 in a subdirectory of Python26/ArcGIS10.0 (!)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When you install your own Python26 it does not copy the link for ArcGIS python extensions&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;move Desktop10.pth and the numpy folder back to C:/Python26/Lib/site-packages&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and all will be standard and well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can then delete the whole ArcGIS10.0 folder so that you only have one version of 2.6 installed&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 23:46:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259079#M8885</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2010-04-29T23:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Importing arcpy error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259080#M8886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;See the tip at the end of this &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z00000008000000.htm"&gt;link&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Aug 2010 14:44:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259080#M8886</guid>
      <dc:creator>JohnFell</dc:creator>
      <dc:date>2010-08-23T14:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Importing arcpy error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259081#M8887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi - I'm having the exact same problem as @bmgustafson.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have followed the advise @kimo posted. However, it didn't seem to work, I'm receiving the error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I posted my issue in full over on &lt;/SPAN&gt;&lt;A href="http://gis.stackexchange.com/questions/6279/import-arcpy-error-runtimeerror-notinitialized-when-using-idle"&gt;gis.stackexchange&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;But have copied my post below:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm receiving the following error when importing arcpy using the the IDLE (gui and cmd prompt) and when using pythonwin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had removed python26 and python25 from my system and have done a fresh install of ArcGIS 10 and python. Therefore am calling IDLE from here: "C:\Python26\ArcGIS10.0\pythonw.exe"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;**IDLE 2.6.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy Traceback (most recent call last): File "", line 1, in import arcpy File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy__init__.py", line 17, in from geoprocessing import gp File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing__init__.py", line 14, in from _base import * File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing_base.py", line 568, in env = GPEnvironments(gp) File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing_base.py", line 565, in GPEnvironments return GPEnvironment(geoprocessor) File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing_base.py", line 521, in init self._refresh() File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing_base.py", line 523, in _refresh envset = (set(env for env in self._gp.listEnvironments())) RuntimeError: NotInitialized**&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EsriUK and Esri tech support have recommended fresh reinstall and registry edits = but this has not worked. I'm waiting on them for a solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've investigated whether it was a module arcpy path issue. There are a couple of links on the Esri forums and on the ArcGIS help regarding paths. Also, a possible related thread on &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;gis.stackexchange&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I followed the advise from 'kimo' on the &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/2158-Importing-arcpy-error"&gt;Esri forum thread&lt;/A&gt;&lt;SPAN&gt;. But still the import error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My system variable (that I've edited) is: PYTHONPATH = "c:\python26";"C:\Python26\ArcGIS10.0";"C:\Python26\ArcGIS10.0\Lib\site-packages";"C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have checked I have the contents of "C:\Python26\ArcGIS10.0\Lib\site-packages\Desktop10.pth". The contents are: C:\Program Files (x86)\ArcGIS\Desktop10.0\bin C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Scripts&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the traceback message shows that a .py script is found in the folder: C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy. Therefore, suggests the arcpy module is found by the interpreter but then not initialized(?).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Arcpy can be called from the Python Window within ArcMap and ArcCatalog okay. It is only when called from a Python interpreter that the 'import arcpy' fails. Therefore, arcpy is initalized okay by ArcMap/ArcCatalog, but not IDLE - how can this be?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I previously had an install of python25, then python26 then after that upgraded to ArcGIS 10. Therefore, there was quite a lot of legacy python on my machine. However, I've uninstalled all and registry cleaned using ccleaner.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone suggest another line of enquiry as I'm not experienced with python enough to solve initialize/runtime errors? I'd like to avoid reinstalling the OS too!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sam&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Feb 2011 08:17:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259081#M8887</guid>
      <dc:creator>RachaelYule</dc:creator>
      <dc:date>2011-02-18T08:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Importing arcpy error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259082#M8888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Also look at the following Knowledge Base - Technical Article, which state that this issue also occurs when ArcGIS Desktop and ArcGIS Server are installed on the same machine but only ArcGIS Server is authorized.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.esri.com/es/knowledgebase/techarticles/detail/39029"&gt;http://support.esri.com/es/knowledgebase/techarticles/detail/39029&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;S&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 May 2013 00:13:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259082#M8888</guid>
      <dc:creator>ScottLarkin</dc:creator>
      <dc:date>2013-05-01T00:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Importing arcpy error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259083#M8889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have had the same problem, both in the office and &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;at a ESRI python course on ESRI PCs.&lt;/SPAN&gt;&lt;SPAN&gt; It seems to be an issue with compatibility between pywin and arcpy. I have since switched to &lt;/SPAN&gt;&lt;A href="https://code.google.com/p/pyscripter/"&gt;pyscripter&lt;/A&gt;&lt;SPAN&gt; and haven't switched back.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 10:23:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259083#M8889</guid>
      <dc:creator>MennoNijhuis1</dc:creator>
      <dc:date>2013-05-03T10:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Importing arcpy error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259084#M8890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was having a similar error to this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I checked the version of ArcMap installed on the computer, and noticed it hadn't been updated to SP1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Installing / updating to 10.1 SP1 solved this issue for us.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Brett&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2013 18:32:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259084#M8890</guid>
      <dc:creator>BrettElliot</dc:creator>
      <dc:date>2013-07-17T18:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Move the pth to the standard location</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259085#M8891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You can then delete the whole ArcGIS10.0 folder so that you only have one version of 2.6 installed&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Do not delete this folder&lt;/STRONG&gt;&lt;SPAN&gt;: ArcCatalog (and maybe ArcMap) require it and will not function correctly without it*. You could test first by moving the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Python26\ArcGIS10.0&lt;/SPAN&gt;&lt;SPAN&gt; folder to a new location or renaming it to see if it is OK for your installation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;* - I had issues moving the folder with ArcGIS 10.1 after installing 64-bit background geoprocessing. My system administrator installed the 64-bit ArcGIS Python to &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;C:\Python27&lt;/SPAN&gt;&lt;SPAN&gt;, when the 32-bit Python had been installed to &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;D:\Python27&lt;/SPAN&gt;&lt;SPAN&gt;. We wanted to move the 32-bit Python but this caused ArcCatalog to crash on opening. Although a number of ESRI registry keys reference the 32-bit Python install path, updating the keys to the new location did not fix the problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jul 2013 21:30:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/importing-arcpy-error/m-p/259085#M8891</guid>
      <dc:creator>StacyRendall1</dc:creator>
      <dc:date>2013-07-29T21:30:09Z</dc:date>
    </item>
  </channel>
</rss>

