Hi all,
I get the following error when I run the script with find_nearest function or any other function from use_proximity module. I am lost, tried all kinds of workarounds, nothing worked so far. I would appreciate any help.
The script is as following:
Solved! Go to Solution.
I changed the environment to conda and the script ran successfully. I don't quite understand why, because arcgis was installed on both environments. Any ideas?
I think because you have only imported find_nearest from use_proximity, when you then reference use_proximity.find_nearest() it croaks.
perhaps try just find_nearest() or otherwise - from arcgis.features import use_proximity
Thank you, I tried what you've proposed before, still same error no matter what.
When I try this create_bufferes function on any hosted layer, I get the same result. I am thinking - can there be a problem with geoprocessing on my end because of my negative arcgis credits balance?
Hi Yulia,
That is definitely possible. A lot of these analysis tools use the default ArcGIS Online utility services, which can incur a credit cost. A worthwhile test may be to add a table/hosted feature layer to a new Web Map in your Portal organization, and then click the Analysis button from the toolbar. Here, we can run the same tools manually, including Find Nearest. If run in the web map, does the tool succeed?
Also, what do you see listed under Portal -> Organization -> Settings -> Utility Services -> Directions and Routing -> Closest Facility (Asynchronous)? If this is an ArcGIS Online URL, then it means that the operation will cost credits according to the credit breakdown here: https://doc.arcgis.com/en/arcgis-online/administer/credits.htm#ESRI_SECTION1_709121D2C7694DCAB9B8592...
The Find Nearest tool using this utility service endpoint to perform the operation.
Thanks,
Calvin
Hi Calvin,
I realized that this issue is not related to credits, because my colleague successfully ran the same script with the same account credentials.
I don't know what else I can do about it. The error persists with all analysis module functions.
Thank you,
Yulia
I changed the environment to conda and the script ran successfully. I don't quite understand why, because arcgis was installed on both environments. Any ideas?
See below for more.
I was having the same issue but with the arcgis.features.analysis.join_features() function. It was returning the same `f = executor.submit(fn...` error. See full error below.
What I eventually did to get it to work was roll back my arcgis installation to v1.8.4. My error was happening on python interpreters using v1.9.1 and v1.8.5.post3. I can't find anything in the release notes that would suggest any change (except maybe this?). @YuliaMamonova, perhaps your conda environment had a different installation of the arcgis package which is why it worked?
This is the second error moving beyond v1.8.4, though they may have cleaned this up in >=2.0. Anyone else have any insight?
Full error:
Traceback (most recent call last):
File "~\venv\lib\site-packages\IPython\core\interactiveshell.py", line 3553, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-17-9f3d49ba8bbe>", line 9, in <cell line: 9>
joined_layer = join_features(
File "~\venv\lib\site-packages\arcgis\features\summarize_data.py", line 748, in join_features
params = inspect_function_inputs(fn=gis._tools.featureanalysis._tbx.join_features, **kwargs)
File "C:\Users\Jacob.Cooper\Documents_LocalOnly\coding\local_ssm\py_venv\venv\lib\site-packages\arcgis\_impl\tools.py", line 678, in _tbx
self._gptbx = import_toolbox(url_or_item=self._url, gis=self._gis, verbose=self._verbose)
File "~\venv\lib\site-packages\arcgis\geoprocessing\_tool.py", line 463, in import_toolbox
f = executor.submit(fn=_generate_fn, **{"task": task, "tbx" :tbx})
TypeError: submit() missing 1 required positional argument: 'fn'
After receiving the TypeError on an arcgis v1.8.4 installation, I did more testing and arrived at the same conclusion as @YuliaMamonova in the solution: it's not mattering which version of arcgis I am using, but the conda-based python interpreter seems to be the key to success for my script. So, my previous suggestion was incorrect. Why conda interpreters work is confounding; the other interpreters I was testing on were either the one installed directly with ArcGIS Pro or downstream virtual environments built off of that original ArcPro interpreter.