<?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: Python scripting error from Map Automation module in ArcMap Questions</title>
    <link>https://community.esri.com/t5/arcmap-questions/python-scripting-error-from-map-automation-module/m-p/1183354#M3853</link>
    <description>&lt;P&gt;Thanks for the ideas, Dan and 2Quiker.&amp;nbsp; I should've posted a snip of my version, what it should look like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SarahBlake_0-1655335086141.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43574i056E3DDB6A4FD391/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SarahBlake_0-1655335086141.png" alt="SarahBlake_0-1655335086141.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I had my student add the 'r' thinking that would help with the path, but it didn't work either way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jun 2022 23:19:44 GMT</pubDate>
    <dc:creator>SarahBlake</dc:creator>
    <dc:date>2022-06-15T23:19:44Z</dc:date>
    <item>
      <title>Python scripting error from Map Automation module</title>
      <link>https://community.esri.com/t5/arcmap-questions/python-scripting-error-from-map-automation-module/m-p/1183346#M3850</link>
      <description>&lt;P&gt;Hi.&amp;nbsp; I'm a GIS Instructor at a community college, trying to incorporate more Python into my curriculum.&amp;nbsp; I've assigned my students the ESRI course, "Python Scripting for Map Automation" for desktop, but one student is having repeated error messages in the second course exercise - see snip below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wondering if there is an issue related to where the Python program 'lives' on the student's computer, and that's why changing the workspace gives errors? Thanks if anyone has ideas on what I can advise the student to try.&lt;/P&gt;&lt;P&gt;Sarah&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SarahBlake_0-1655331620694.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43571i20A09164F2E9389C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SarahBlake_0-1655331620694.png" alt="SarahBlake_0-1655331620694.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 22:28:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/python-scripting-error-from-map-automation-module/m-p/1183346#M3850</guid>
      <dc:creator>SarahBlake</dc:creator>
      <dc:date>2022-06-15T22:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Python scripting error from Map Automation module</title>
      <link>https://community.esri.com/t5/arcmap-questions/python-scripting-error-from-map-automation-module/m-p/1183350#M3851</link>
      <description>&lt;P&gt;missing a \&lt;/P&gt;&lt;LI-CODE lang="python"&gt;path = r"c:\folder\sub"

path + r"\some.gdb"  # -- add \
'c:\\folder\\sub\\some.gdb'&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Jun 2022 22:57:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/python-scripting-error-from-map-automation-module/m-p/1183350#M3851</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-06-15T22:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python scripting error from Map Automation module</title>
      <link>https://community.esri.com/t5/arcmap-questions/python-scripting-error-from-map-automation-module/m-p/1183351#M3852</link>
      <description>&lt;P&gt;Try remove the "r" from &lt;STRONG&gt;&lt;EM&gt;r&lt;/EM&gt;&lt;/STRONG&gt;"\city of westervill.mdb" and &lt;EM&gt;&lt;STRONG&gt;r&lt;/STRONG&gt;&lt;/EM&gt;"\westerville.gdb". Are both the mdb and gdb in the same folder "c:\esritraining\mapscripting? Include arcpy.env.workspace&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have always done something like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;mxd = arcpy.mapping.MapDocument("CURRENT")#mxd = arcpy.mapping.MapDocument(mxd)

mxd.findAndReplaceWorkspacePaths(r"Database Connections\Connection to OLD_sqlexpress.sde", r"Database Connections\Connection to New_sqlexpress.sde") #Database Servers\***.gds

for lyr in arcpy.mapping.ListLayers(mxd): 
    if lyr.name == "CITY_LIMITS":
        lyr.replaceDataSource(r"C:\Users\***\AppData\Roaming\ESRI\Desktop10.7\ArcCatalog\***.gds", "SDE_WORKSPACE", "***.DBO.City_Limits","")
print "Successfully updated CITY_lIMITS data sources"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/10.6/analyze/arcpy-mapping/updatingandfixingdatasources.htm" target="_blank"&gt;https://desktop.arcgis.com/en/arcmap/10.6/analyze/arcpy-mapping/updatingandfixingdatasources.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 23:03:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/python-scripting-error-from-map-automation-module/m-p/1183351#M3852</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2022-06-15T23:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Python scripting error from Map Automation module</title>
      <link>https://community.esri.com/t5/arcmap-questions/python-scripting-error-from-map-automation-module/m-p/1183354#M3853</link>
      <description>&lt;P&gt;Thanks for the ideas, Dan and 2Quiker.&amp;nbsp; I should've posted a snip of my version, what it should look like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SarahBlake_0-1655335086141.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43574i056E3DDB6A4FD391/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SarahBlake_0-1655335086141.png" alt="SarahBlake_0-1655335086141.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I had my student add the 'r' thinking that would help with the path, but it didn't work either way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 23:19:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/python-scripting-error-from-map-automation-module/m-p/1183354#M3853</guid>
      <dc:creator>SarahBlake</dc:creator>
      <dc:date>2022-06-15T23:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Python scripting error from Map Automation module</title>
      <link>https://community.esri.com/t5/arcmap-questions/python-scripting-error-from-map-automation-module/m-p/1183569#M3854</link>
      <description>&lt;P&gt;the student was missing a "\" not just the r thing&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 15:01:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/python-scripting-error-from-map-automation-module/m-p/1183569#M3854</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-06-16T15:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Python scripting error from Map Automation module</title>
      <link>https://community.esri.com/t5/arcmap-questions/python-scripting-error-from-map-automation-module/m-p/1183614#M3855</link>
      <description>&lt;P&gt;Hi.&amp;nbsp; So, yes the .gdb and the .mdb in this ESRI training module both exist in "C:\EsriTraining\MapScripting" folder...The "r" and extra "\" were not needed per the training module directions (I only has student add that later in effort to get code to work) - if look at my (not student) script in snip above, the code is the way the instructions were written in module (but didn't work for student).&amp;nbsp; The student copied/pasted the code from the Esri training directions originally, so I still wonder if the error codes have something to do with a different version of Python being referred to....this student (like I do too) has more than one version of Python installed, since Pro uses different version than ArcMap.&amp;nbsp; So maybe the question is how to make sure ArcMap is pulling from the correct one? Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 16:10:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/python-scripting-error-from-map-automation-module/m-p/1183614#M3855</guid>
      <dc:creator>SarahBlake</dc:creator>
      <dc:date>2022-06-16T16:10:59Z</dc:date>
    </item>
  </channel>
</rss>

