<?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 Attribute Error: Object: Environment &amp;amp;lt;workspace&amp;amp;gt; not found in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/attribute-error-object-environment-amp-lt/m-p/365096#M12562</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a Python script that uses the subprocess module to call another script using subprocess.call(). The code works well when run from PythonWin, but if I import the parent script into ArcToolbox and run it from there I get some odd errors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the parent script is run "out of process" I get the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Attribute Error: Object: Environment &amp;lt;workspace&amp;gt; not found&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If it's run "in process" I get:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;The subprocess script returned a non-zero exit code&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The second error message is quite difficult to de-bug, as everything runs fine from PythonWin/IDLE - it's only from ArcToolbox that I have trouble. Does anyone have any idea what might be causing the first error message?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The folder that I'm trying to set as a workspace does exist, so I can't think why it's "not found". Is it possible that there's some kind of conflict between the default environment settings in ArcToolbox and the environment settings that I try to use in my subprocess?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I originally assumed that when I ran a script "out of process" ArcToolbox would simply start Python.exe and pass it the input parameters. It's obviously a bit more complicated than this though as the script works fine when run from the command line. What else is going on that I'm missing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions gratefully received. Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Nov 2010 11:52:57 GMT</pubDate>
    <dc:creator>jamessample</dc:creator>
    <dc:date>2010-11-22T11:52:57Z</dc:date>
    <item>
      <title>Attribute Error: Object: Environment &amp;lt;workspace&amp;gt; not found</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/attribute-error-object-environment-amp-lt/m-p/365096#M12562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a Python script that uses the subprocess module to call another script using subprocess.call(). The code works well when run from PythonWin, but if I import the parent script into ArcToolbox and run it from there I get some odd errors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the parent script is run "out of process" I get the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Attribute Error: Object: Environment &amp;lt;workspace&amp;gt; not found&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If it's run "in process" I get:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;The subprocess script returned a non-zero exit code&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The second error message is quite difficult to de-bug, as everything runs fine from PythonWin/IDLE - it's only from ArcToolbox that I have trouble. Does anyone have any idea what might be causing the first error message?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The folder that I'm trying to set as a workspace does exist, so I can't think why it's "not found". Is it possible that there's some kind of conflict between the default environment settings in ArcToolbox and the environment settings that I try to use in my subprocess?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I originally assumed that when I ran a script "out of process" ArcToolbox would simply start Python.exe and pass it the input parameters. It's obviously a bit more complicated than this though as the script works fine when run from the command line. What else is going on that I'm missing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions gratefully received. Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Nov 2010 11:52:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/attribute-error-object-environment-amp-lt/m-p/365096#M12562</guid>
      <dc:creator>jamessample</dc:creator>
      <dc:date>2010-11-22T11:52:57Z</dc:date>
    </item>
  </channel>
</rss>

