<?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: Strange problem when run a script from other script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/strange-problem-when-run-a-script-from-other/m-p/1308435#M68172</link>
    <description>&lt;P&gt;The original code has all the needed import statements.&lt;/P&gt;&lt;P&gt;I just did not want to put extra lines in my post.&lt;/P&gt;</description>
    <pubDate>Sun, 16 Jul 2023 04:58:00 GMT</pubDate>
    <dc:creator>mody_buchbinder</dc:creator>
    <dc:date>2023-07-16T04:58:00Z</dc:date>
    <item>
      <title>Strange problem when run a script from other script</title>
      <link>https://community.esri.com/t5/python-questions/strange-problem-when-run-a-script-from-other/m-p/1307237#M68134</link>
      <description>&lt;P&gt;I have script a.py that have one line:&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = r"C:\temp"&lt;/P&gt;&lt;P&gt;I am running this script with the line:&lt;/P&gt;&lt;P&gt;proc = subprocess.Popen([r"C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe", r"D:\temp\a.py"])&lt;/P&gt;&lt;P&gt;When I run it from the python window in Pro 3.1 it runs with no error.&lt;/P&gt;&lt;P&gt;When I create script b.py that have only this line and make a tool out of it I get the error the GPEnvironment&lt;/P&gt;&lt;P&gt;have no method workspace&lt;/P&gt;&lt;P&gt;This works good in Pro 2.X&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mody&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 13:07:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-problem-when-run-a-script-from-other/m-p/1307237#M68134</guid>
      <dc:creator>mody_buchbinder</dc:creator>
      <dc:date>2023-07-11T13:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Strange problem when run a script from other script</title>
      <link>https://community.esri.com/t5/python-questions/strange-problem-when-run-a-script-from-other/m-p/1307820#M68150</link>
      <description>&lt;P&gt;don't you need to `import arcpy`? The python window in arcgis pro doesn't need `import arcpy` since it is already imported by launching the application.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 05:34:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-problem-when-run-a-script-from-other/m-p/1307820#M68150</guid>
      <dc:creator>AzinSharaf</dc:creator>
      <dc:date>2023-07-13T05:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Strange problem when run a script from other script</title>
      <link>https://community.esri.com/t5/python-questions/strange-problem-when-run-a-script-from-other/m-p/1308435#M68172</link>
      <description>&lt;P&gt;The original code has all the needed import statements.&lt;/P&gt;&lt;P&gt;I just did not want to put extra lines in my post.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jul 2023 04:58:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-problem-when-run-a-script-from-other/m-p/1308435#M68172</guid>
      <dc:creator>mody_buchbinder</dc:creator>
      <dc:date>2023-07-16T04:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Strange problem when run a script from other script</title>
      <link>https://community.esri.com/t5/python-questions/strange-problem-when-run-a-script-from-other/m-p/1308530#M68175</link>
      <description>&lt;P&gt;Just did some more testing.&lt;/P&gt;&lt;P&gt;The "workspace" line fail even if I run it using a bat file or replace subprocess.popen with os.system.&lt;/P&gt;&lt;P&gt;As I say it runs from all options, direct from IDLE or from pro python window but not when I define it as a tool.&lt;/P&gt;&lt;P&gt;And the strangest thing - the line&amp;nbsp;arcpy.env.overwriteOutput = True does work. I did not tried other env's but it looks only the workspace have a problem.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 08:13:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-problem-when-run-a-script-from-other/m-p/1308530#M68175</guid>
      <dc:creator>mody_buchbinder</dc:creator>
      <dc:date>2023-07-17T08:13:34Z</dc:date>
    </item>
  </channel>
</rss>

