Python bug in ArcGIS - Urban Network analysis tool

Станимира Николова stanimira.s.93 at gmail.com
Tue Jul 31 08:02:46 EDT 2018


понеделник, 30 юли 2018 г., 15:19:43 UTC+3, Andrew MacIntyre написа:
> On 30/07/2018 4:02 PM, Станимира Николова wrote:
> 
> >>>>> I run Urban network analysis but It shows similar mistake several times. The UNA tool is free plugin that i downloaded, it's not from the default intalled in ArcGIS packed. It ask for integer data.
> >>>>> I checked the type of the attributes, it's all integer. PLus it's all in geo data based file.
> >>>>>
> >>>>> Unfortunately I don't understand Python, I'm one of those who use ArcGIS as sample customer.
> >>>>>
> >>>>> This is the mistake:
> >>>>>
> >>>>> Start Time: Fri Jul 27 14:48:32 2018
> >>>>> Running script Centrality...
> >>>>> [started] Copying input buildings
> >>>>> [finished]
> >>>>> [1 started] Computing adjacency list
> >>>>> [1 failed]
> >>>>> Not successful
> >>>>> Completed script Centrality...
> >>>>> Succeeded at Fri Jul 27 14:48:36 2018 (Elapsed Time: 4,56 seconds)
> >>>>>
> >>>>> Any suggestions? How it's calling these adjaency list? What could be wrong? I even don't know how to get debugger, so it could give me more information.
> 
> If it's a third party plugin, contact the author or source.  This 
> mailing list sees very little traffic about ArcGIS usage as it is a 
> highly specialised commercial product.
> 
> > I add in a project the .py file for the adjacency list.
> > 
> > That's the main from the debuger:
> > 
> > pydev debugger: process 8904 is connecting
> > 
> > Connected to pydev debugger (build 182.3684.100)
> > Traceback (most recent call last):
> >    File "C:\Program Files\JetBrains\PyCharm 2018.2\helpers\pydev\pydevd.py", line 1664, in <module>
> >      main()
> >    File "C:\Program Files\JetBrains\PyCharm 2018.2\helpers\pydev\pydevd.py", line 1658, in main
> >      globals = debugger.run(setup['file'], None, None, is_module)
> >    File "C:\Program Files\JetBrains\PyCharm 2018.2\helpers\pydev\pydevd.py", line 1068, in run
> >      pydev_imports.execfile(file, globals, locals)  # execute the script
> >    File "C:\Program Files\JetBrains\PyCharm 2018.2\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
> >      exec(compile(contents+"\n", file, 'exec'), glob, loc)
> >    File "D:/INSTALL/Urban Network Analysis Toolbox 1.01/src/Centrality/Adjacency_List_Computation.py", line 14, in <module>
> >      from arcpy import AddField_management
> > ModuleNotFoundError: No module named 'arcpy'
> > 
> > May I found the following lines from the code?
> 
> Is it documented that the file you've attempted to run via PyCharm 
> actually supports being run from outside ArcGIS?  Most plugins don't 
> seem to be...  This failure is because PyCharm isn't starting the script 
> with the necessary environment (including the arcpy ArcGIS Python 
> module) accessible.
> 
> The fact that it starts running from within ArcGIS and produces some 
> status messages before bailing out with the failure message strongly 
> suggests to me that the plugin is working properly but the input given 
> is not sufficient to produce the expected output.  In the absence of 
> sufficient documentation for you to figure out the required input, my 
> advice above stands: contact the author or the download source.
> 
> If you or your organisation has a current ArcGIS maintenance agreement, 
> you might also be able to access the community forums that ESRI run to 
> ask for more info about this plugin.
> 
> -- 
> -------------------------------------------------------------------------
> Andrew I MacIntyre                     "These thoughts are mine alone..."
> E-mail: andymac at bullseye.apana.org.au  (pref) | Snail: PO Box 370
>          andymac at pcug.org.au             (alt) |        Belconnen ACT 2616
> Web:    http://www.andymac.org/               |        Australia

Hi Andrew,
Thanks for your reply.

I managed to resolve the problem.

It seems that just the plugin doesn't found the python paths of it's environments and libraries. As I understood the adj. list is "calling" for functions in the other python files of the plugin (plus functions from ArcGIS).

What I've done (me and one IT specialist, actually):
 - Found the pythonpath of the module arcpy in the folder of default installed ArcGIS
 - Copied the pythonpath file, for the connection with module arcpy, in the folder with scripts of the plugin (UNA tool)
 - opened Python 3.7 and called for arcpy of the plugin. There we saw the paths of all enviroments that might use the plugin. The path to the arcpy appeared.

After that I got few mistakes of the input data, because I had to make unique ID of all the data points in the folder.

And tadamm … it works. 

Thanks for all the suggestions.
Mira.


More information about the Python-list mailing list