<?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: Import Error When Running Toolbox in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/import-error-when-running-toolbox/m-p/536324#M41978</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is designed to work with ArcMap apparently.&amp;nbsp; If you are using ArcGIS Pro, it won't work without recoding.&amp;nbsp; Contact the authors and see if they have a version for ArcGIS Pro.&lt;/P&gt;&lt;P&gt;PS ArcMap 10.2 was a long time ago and is into the "mature" phase, meaning, nothing more will be done to support it &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Mar 2020 18:08:36 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2020-03-16T18:08:36Z</dc:date>
    <item>
      <title>Import Error When Running Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/import-error-when-running-toolbox/m-p/536323#M41977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: small;"&gt;I am using the&amp;nbsp;Urban Network Analysis toolbox by City Form Lab&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="http://cityform.mit.edu/projects/urban-network-analysis.html" style="color: #2989c5; text-decoration: none;" title="http://cityform.mit.edu/projects/urban-network-analysis.html"&gt;Urban Network Analysis Toolbox for ArcGIS — City Form Lab&lt;/A&gt;.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;But it doesn't seem to work&amp;nbsp;for me.&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: small;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: small;"&gt;When I run it with the Test Files provided, the following error shows up.&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: small;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: small;"&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "C:\Users\*\Urban Network Analysis Toolbox\src\Centrality_Main.py", line 7, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; from Centrality.Main import main&lt;BR /&gt;&amp;nbsp; File "C:\Users\*\Urban Network Analysis Toolbox\src\Centrality\Main.py", line 28, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; from arcpy import mapping&lt;BR /&gt;ImportError: cannot import name 'mapping'&lt;BR /&gt;&amp;nbsp;Failed to execute (Centrality).&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: small;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: small;"&gt;It seems that mapping is now changed to mp according to this article&amp;nbsp;&lt;A data-saferedirecturl="https://www.google.com/url?q=https://pro.arcgis.com/en/pro-app/arcpy/mapping/migratingfrom10xarcpymapping.htm&amp;amp;source=gmail&amp;amp;ust=1584464650673000&amp;amp;usg=AFQjCNFXll2Np0cQVRjz9mqpdna4HAVR_A" href="https://pro.arcgis.com/en/pro-app/arcpy/mapping/migratingfrom10xarcpymapping.htm" style="color: #1155cc;" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/arcpy/mapping/migratingfrom10xarcpymapping.htm&lt;/A&gt;&lt;SPAN&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: small;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: small;"&gt;But even I change mapping into mp in the code, this error repeats for 'from Adjacency_List_Computation import compute_adjacency_list', 'from Centrality_Computation import compute_centrality' and 'from Constants import xxx' from line 36 to 116 of Centrality\Main.py .&amp;nbsp; &lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;This tool was designed to use with ArcGIS 10.2, but I am using ArcGIS Pro 2.4 since it is the version of trail available, is that the reason the toolbox doesn't work? If so, is there any way to fix it?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Alvin&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2020 17:45:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-error-when-running-toolbox/m-p/536323#M41977</guid>
      <dc:creator>SumLam</dc:creator>
      <dc:date>2020-03-16T17:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Import Error When Running Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/import-error-when-running-toolbox/m-p/536324#M41978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is designed to work with ArcMap apparently.&amp;nbsp; If you are using ArcGIS Pro, it won't work without recoding.&amp;nbsp; Contact the authors and see if they have a version for ArcGIS Pro.&lt;/P&gt;&lt;P&gt;PS ArcMap 10.2 was a long time ago and is into the "mature" phase, meaning, nothing more will be done to support it &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2020 18:08:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-error-when-running-toolbox/m-p/536324#M41978</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-16T18:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Import Error When Running Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/import-error-when-running-toolbox/m-p/536325#M41979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May I also know to what extend it need to be recoded? Is it possible to make it work by changing the import section only? And where could I find some tutorial?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like mapping it should be changed to mp, does anyone have clue about 'Constants' and the remaining?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2020 19:24:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-error-when-running-toolbox/m-p/536325#M41979</guid>
      <dc:creator>SumLam</dc:creator>
      <dc:date>2020-03-16T19:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Import Error When Running Toolbox</title>
      <link>https://community.esri.com/t5/python-questions/import-error-when-running-toolbox/m-p/536326#M41980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;on top of that, python 2 vs python 3 changes may be involved.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://cityform.mit.edu/projects/urban-network-analysis.html" title="http://cityform.mit.edu/projects/urban-network-analysis.html"&gt;Urban Network Analysis Toolbox for ArcGIS — City Form Lab&lt;/A&gt;&amp;nbsp;.... there is a forum link... try there to see if an updated version is available&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2020 19:28:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-error-when-running-toolbox/m-p/536326#M41980</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-16T19:28:54Z</dc:date>
    </item>
  </channel>
</rss>

