Calling Arc Hydro Tools in Python in ArcGIS Pro?

5533
20
03-02-2018 02:51 PM
Labels (1)
JohnGaiot
Occasional Contributor

Hello,

I am testing some python scripts created originally in ArcGIS 10.3.1/10.5.1 which utilize the ArcHydroTools module. I have installed the latest Arc Hydro package in ArcGIS Pro, but it still doesn't recognize this module. I get the following error when trying to import the module:

" ModuleNotFoundError: No module named 'ArcHydroTools' "

Is this functionality not yet available? Or should I be doing something else?

I tried scouring the documentation but it all relates to ArcGIS desktop not Pro. Not that I could find anyway!

Thanks in advance,

John

0 Kudos
20 Replies
DanPatterson_Retired
MVP Emeritus

packages designed for arcmap would also have a separate install for ArcGIS Pro. 

The location is here http://downloads.esri.com/archydro/ArcHydro/Setup/Pro/

I would hope that there are installation instructions for the version of PRO that you are using... I didn't investigate further

JohnGaiot
Occasional Contributor

Yes I tried installing the latest version listed there and no luck. I couldn't find any documentation either on this site.. it's all old help files for ArcGIS.

0 Kudos
DanPatterson_Retired
MVP Emeritus

You will have to wait until someone that uses the new version wades in since I think Arc Hydro is in a bit of a limbo at present

0 Kudos
V_StuartFoote
MVP Frequent Contributor

Insert the Arc_Hydro_Tools_Pro.tbx toolbox to the project Catalog for use,  the resource path to the installion is Program Files -> ArcGIS -> Pro -> Resources -> ArcToolBox ->Toolboxes

Each tool/script in the toolbox has the Syntax of the script, but no Usage or Code samples--those have not really changed once the toolbox is added to the Project.

JohnGaiot
Occasional Contributor

Thanks for the tip for adding the toolbox, but I am still getting the same error. Either the python functionality isn't there yet or they changed how to access it.. which would be unfortunate, since many of the standard tools are accessed exactly the same way under both platforms (with a few notable exceptions - but they're usually well explained). The same should hold true for Arc Hydro. 

0 Kudos
DanPatterson_Retired
MVP Emeritus

Were there any instructions in the *.msi?

Since PRO is a new beast and requires an Anaconda setup and distribution of python.  I would not assume that an installation as before would remotely work since it would have to have been installed within the PRO/Anaconda package distribution.

0 Kudos
JohnGaiot
Occasional Contributor

Unfortunately no readme file currently comes with the MSI file that I can see. Would be most helpful

0 Kudos
V_StuartFoote
MVP Frequent Contributor

Julio Novoa  gave this good hint in this thread (Arc Hydro Setup Versions and Documentation ) regards needing a README.txt configuration note:

1. Extract the zip file to the location where you want to install ArcHydroPro

2. Edit the file archydropython.pth so that the path points to the location of ArcHydro\Scripts\ArcHydro (e.g. C:\Tools\ArcHydroPro\Scripts\ArcHydro).

3. Copy the edited archydropython.pth to %ProgramFiles%\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages.


Otherwise you won't be able to run ArcHydro from ArcGIS Pro. ArcHydro uses Python from the default conda environment arcgispro-py3.

0 Kudos
JohnGaiot
Occasional Contributor

Thanks for this tip! I'll give it a try hopefully this afternoon and will report back if successful.

0 Kudos