<?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 code works in ArcGIS 10.0 but not in ArcGIS 10.2 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-code-works-in-arcgis-10-0-but-not-in-arcgis/m-p/96696#M7477</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Val,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try looking at the following URL on paths in Python.&amp;nbsp; To me, you just need to fix the first two paths.&amp;nbsp; They use single backslashes.&amp;nbsp; This looks like you converted a model to Python, but the paths look like they were copied and pasted from ArcCatalog.&amp;nbsp; When you do that, usually you get single backslashes, the way Windows specifies paths.&amp;nbsp; You can add an r before the paths, or change the backslashes to double backslashes or single forward slashes.&amp;nbsp; That will probably fix it.&amp;nbsp; I paste from ArcCatalog sometimes, and then I get errors until I fix the path strings.&amp;nbsp; Look up more information about paths in Python.&amp;nbsp; The problem is that single backslashes are treated like the beginning of an escape sequence, so you either have to use the universal "/" in Python, escape the backslashes ("\\"), or specify that the strings are raw and to read them as is (r"").&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000000r000000"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000000r000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Jan 2014 21:52:40 GMT</pubDate>
    <dc:creator>NathanHeick</dc:creator>
    <dc:date>2014-01-02T21:52:40Z</dc:date>
    <item>
      <title>Python code works in ArcGIS 10.0 but not in ArcGIS 10.2</title>
      <link>https://community.esri.com/t5/python-questions/python-code-works-in-arcgis-10-0-but-not-in-arcgis/m-p/96693#M7474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I know the there is anew version of Python that is running on arcGIS 10.2 Pythin 2.7.3??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyways these are simple out of the box functions that work in 10.0 but now not in 10.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code snippet, last line it erros on saying it cannot fin the resource?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Local variables:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIVE_CIP_Shapes = "Database Connections\Connection to bangkok as clvgis.sde\LIVE.CIP_Shapes"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IMSV7_CLV_CIPMAP = "Database Connections\Connection to HANSEN DEV as IMSV7_READ.odc\IMSV7.CLV_CIPMAP"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;temp_workspace_gdb = "//naples/gis_workspace/clvgis/appdata/CIP/UpdatedCIP.gdb"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Output_Layer = "CIP_Shapes_Layer"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CIP_Shapes_Layer = "CIP_Shapes_Layer"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CIP_Shapes_Layer__2_ = "CIP_Shapes_Layer"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Make Feature Layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeFeatureLayer_management(LIVE_CIP_Shapes, Output_Layer, "", "", "OBJECTID OBJECTID VISIBLE NONE;HANSEN HANSEN VISIBLE NONE;HANSEN2 HANSEN2 VISIBLE NONE;SHAPE SHAPE VISIBLE NONE;SHAPE.AREA SHAPE.AREA VISIBLE NONE;SHAPE.LEN SHAPE.LEN VISIBLE NONE")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Add Join&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddJoin_management(Output_Layer, "HANSEN", IMSV7_CLV_CIPMAP, "APPROJECTID", "KEEP_ALL")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ERRROR MESSAGE&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000732: Join Table: Dataset Database Connections\Connection to HANSEN DEV as IMSV7_READ.odc\IMSV7.CLV_CIPMAP does not exist or is not supported&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (AddJoin).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Dec 2013 16:11:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-code-works-in-arcgis-10-0-but-not-in-arcgis/m-p/96693#M7474</guid>
      <dc:creator>ValBalent</dc:creator>
      <dc:date>2013-12-31T16:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python code works in ArcGIS 10.0 but not in ArcGIS 10.2</title>
      <link>https://community.esri.com/t5/python-questions/python-code-works-in-arcgis-10-0-but-not-in-arcgis/m-p/96694#M7475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Val,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try performing the join manually using the Add Join tool.&amp;nbsp; If the tool completes, open your Results window (Geoprocessing menu &amp;gt; Results) and then right-click on the result &amp;gt; Copy As Python Snippet.&amp;nbsp; You can then paste this into a text editor and compare this to your current script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Dec 2013 17:32:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-code-works-in-arcgis-10-0-but-not-in-arcgis/m-p/96694#M7475</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-12-31T17:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Python code works in ArcGIS 10.0 but not in ArcGIS 10.2</title>
      <link>https://community.esri.com/t5/python-questions/python-code-works-in-arcgis-10-0-but-not-in-arcgis/m-p/96695#M7476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This looks like the issue of not properly specifying your paths.&amp;nbsp; Windows uses backslashes and Linux uses forward slashes.&amp;nbsp; In Python, forward slashes will always work or you can use os.path.sep to get the proper separator for your operating system.&amp;nbsp; If you use one backslash, Python reads it as the start of an escape code, so you have to escape it with double backslashes.&amp;nbsp; The final alternative is to use raw strings and add a lower case r before your path like follows.&amp;nbsp; This reads the string as is, which works correctly in windows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;LIVE_CIP_Shapes = r"Database Connections\Connection to bangkok as clvgis.sde\LIVE.CIP_Shapes"
 IMSV7_CLV_CIPMAP = r"Database Connections\Connection to HANSEN DEV as IMSV7_READ.odc\IMSV7.CLV_CIPMAP"
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Having run across the same issue before, I imagine you copied and pasted the path from ArcCatalog.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a link from the ArcGIS help on paths.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000000r000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000000r000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:04:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-code-works-in-arcgis-10-0-but-not-in-arcgis/m-p/96695#M7476</guid>
      <dc:creator>NathanHeick</dc:creator>
      <dc:date>2021-12-11T06:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Python code works in ArcGIS 10.0 but not in ArcGIS 10.2</title>
      <link>https://community.esri.com/t5/python-questions/python-code-works-in-arcgis-10-0-but-not-in-arcgis/m-p/96696#M7477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Val,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try looking at the following URL on paths in Python.&amp;nbsp; To me, you just need to fix the first two paths.&amp;nbsp; They use single backslashes.&amp;nbsp; This looks like you converted a model to Python, but the paths look like they were copied and pasted from ArcCatalog.&amp;nbsp; When you do that, usually you get single backslashes, the way Windows specifies paths.&amp;nbsp; You can add an r before the paths, or change the backslashes to double backslashes or single forward slashes.&amp;nbsp; That will probably fix it.&amp;nbsp; I paste from ArcCatalog sometimes, and then I get errors until I fix the path strings.&amp;nbsp; Look up more information about paths in Python.&amp;nbsp; The problem is that single backslashes are treated like the beginning of an escape sequence, so you either have to use the universal "/" in Python, escape the backslashes ("\\"), or specify that the strings are raw and to read them as is (r"").&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000000r000000"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000000r000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 21:52:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-code-works-in-arcgis-10-0-but-not-in-arcgis/m-p/96696#M7477</guid>
      <dc:creator>NathanHeick</dc:creator>
      <dc:date>2014-01-02T21:52:40Z</dc:date>
    </item>
  </channel>
</rss>

