<?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 Schedule a script: ImportError: No module named arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/schedule-a-script-importerror-no-module-named/m-p/531014#M41594</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi folks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've added a script to a toolbox that I'd like to run every X minutes as a scheduled task. If I try and run my .py file from command line I cannot import arcpy:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]ImportError: No module named arcpy[/HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Same message if I try and run the script in PyDev for Eclipse, or Idle. I've read &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/23230-quot-ImportError-No-module-named-arcpy-quot-PYTHON"&gt;this thread &lt;/A&gt;&lt;SPAN&gt;but with no joy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;Info&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm on Windows 7, 64bit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this folder exits: C:\Python26\ArcGIS10.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know where Desktop10.pth file is?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have no PYTHONPATH variable&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any pointers appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;James&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jun 2011 11:49:22 GMT</pubDate>
    <dc:creator>deleted-user-VeZur_n9o0OZ</dc:creator>
    <dc:date>2011-06-06T11:49:22Z</dc:date>
    <item>
      <title>Schedule a script: ImportError: No module named arcpy</title>
      <link>https://community.esri.com/t5/python-questions/schedule-a-script-importerror-no-module-named/m-p/531014#M41594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi folks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've added a script to a toolbox that I'd like to run every X minutes as a scheduled task. If I try and run my .py file from command line I cannot import arcpy:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]ImportError: No module named arcpy[/HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Same message if I try and run the script in PyDev for Eclipse, or Idle. I've read &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/23230-quot-ImportError-No-module-named-arcpy-quot-PYTHON"&gt;this thread &lt;/A&gt;&lt;SPAN&gt;but with no joy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;Info&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm on Windows 7, 64bit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this folder exits: C:\Python26\ArcGIS10.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know where Desktop10.pth file is?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have no PYTHONPATH variable&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any pointers appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;James&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 11:49:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/schedule-a-script-importerror-no-module-named/m-p/531014#M41594</guid>
      <dc:creator>deleted-user-VeZur_n9o0OZ</dc:creator>
      <dc:date>2011-06-06T11:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule a script: ImportError: No module named arcpy</title>
      <link>https://community.esri.com/t5/python-questions/schedule-a-script-importerror-no-module-named/m-p/531015#M41595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Update:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have located Desktop10.pth here:C:\Python26\ArcGIS10.0\Lib\site-packages. It contains these entries:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Program Files (x86)\ArcGIS\Desktop10.0\bin&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Scripts&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am i right in saying I need to reference arcpy somewhere centrally so python.exe can run my scripts outside of ArcGIS?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;James&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 12:39:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/schedule-a-script-importerror-no-module-named/m-p/531015#M41595</guid>
      <dc:creator>deleted-user-VeZur_n9o0OZ</dc:creator>
      <dc:date>2011-06-06T12:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule a script: ImportError: No module named arcpy</title>
      <link>https://community.esri.com/t5/python-questions/schedule-a-script-importerror-no-module-named/m-p/531016#M41596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;how do you type your command?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if you don't add "python.exe" to your PATH system variable, you must specify it in the command line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;c:\Users\Yourname&amp;gt; c:\Python26\ArcGIS10.0\python.exe yourscript.py&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ciao,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AC&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 14:45:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/schedule-a-script-importerror-no-module-named/m-p/531016#M41596</guid>
      <dc:creator>AlessandroCinnirella</dc:creator>
      <dc:date>2011-06-06T14:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule a script: ImportError: No module named arcpy</title>
      <link>https://community.esri.com/t5/python-questions/schedule-a-script-importerror-no-module-named/m-p/531017#M41597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;See &lt;/SPAN&gt;&lt;A href="http://www.itechtalk.com/thread542.html"&gt;http://www.itechtalk.com/thread542.html&lt;/A&gt;&lt;SPAN&gt; for instructions on how to add the Python directory to your system's path variable.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 16:13:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/schedule-a-script-importerror-no-module-named/m-p/531017#M41597</guid>
      <dc:creator>RuthEmerick</dc:creator>
      <dc:date>2011-06-06T16:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule a script: ImportError: No module named arcpy</title>
      <link>https://community.esri.com/t5/python-questions/schedule-a-script-importerror-no-module-named/m-p/531018#M41598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks guys. I was running C:\Python26\python.exe in my bat file so have now changed this to C:\Python26\ArcGIS10.0\python.exe. Also, in PyDev preferences (Window &amp;gt; preferences &amp;gt; PyDev &amp;gt; Interpreter Python &amp;gt; I've updated interpreters to reflect this so I can now run my scripts in Eclipse. I ran the bat file successfully as a scheduled task all night.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ruth, I have appended ';C:\Python26\ArcGIS10.0' to my Path environment variable. Is that correct? Should that resolve the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;my script fails If I run it from windows explorer (double clicking it).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I receive the following message running my script in IDLE:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcgisscripting&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ImportError: DLL load failed: %1 is not a valid Win32 application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;James&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 08:18:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/schedule-a-script-importerror-no-module-named/m-p/531018#M41598</guid>
      <dc:creator>deleted-user-VeZur_n9o0OZ</dc:creator>
      <dc:date>2011-06-07T08:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule a script: ImportError: No module named arcpy</title>
      <link>https://community.esri.com/t5/python-questions/schedule-a-script-importerror-no-module-named/m-p/531019#M41599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;my script fails If I run it from windows explorer (double clicking it).&lt;BR /&gt;I receive the following message running my script in IDLE:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;import arcgisscripting&lt;BR /&gt;ImportError: DLL load failed: %1 is not a valid Win32 application.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Check and make sure that the C:\Python26\ArcGIS10.0\Lib\site-packages\Desktop10.pth file contains the following two lines (you can edit it with Notepad):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Program Files\ArcGIS\Desktop10.0\bin&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Program Files\ArcGIS\Desktop10.0\arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If not, &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z00000008000000.htm"&gt;add them&lt;/A&gt;&lt;SPAN&gt;. Hopefully that's the problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 14:20:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/schedule-a-script-importerror-no-module-named/m-p/531019#M41599</guid>
      <dc:creator>RuthEmerick</dc:creator>
      <dc:date>2011-06-07T14:20:13Z</dc:date>
    </item>
  </channel>
</rss>

