AnsweredAssumed Answered

Import Error When Running Toolbox

Question asked by laulamlee on Mar 16, 2020
Latest reply on Mar 16, 2020 by Dan_Patterson
I am using the Urban Network Analysis toolbox by City Form Lab Urban Network Analysis Toolbox for ArcGIS — City Form Lab. But it doesn't seem to work for me.
When I run it with the Test Files provided, the following error shows up.
Traceback (most recent call last):
  File "C:\Users\*\Urban Network Analysis Toolbox\src\Centrality_Main.py", line 7, in <module>
    from Centrality.Main import main
  File "C:\Users\*\Urban Network Analysis Toolbox\src\Centrality\Main.py", line 28, in <module>
    from arcpy import mapping
ImportError: cannot import name 'mapping'
 Failed to execute (Centrality).
It seems that mapping is now changed to mp according to this article https://pro.arcgis.com/en/pro-app/arcpy/mapping/migratingfrom10xarcpymapping.htm
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 . 
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?
Alvin

Outcomes