0

Has anyone had success importing the Arc Hydro toolbox or importing the archydro module in a python script?

tbx = arcpy.ImportToolbox(r"C:\Program Files\ArcGIS\Pro\Resources\ArcToolBox\toolboxes\Arc_Hydro_Tools_Pro.tbx")

---------------------------------------------------------------------------
SyntaxError                               Traceback (most recent call last)
In  [25]:
Line 1:     tbx = arcpy.ImportToolbox(r"C:\Program Files\ArcGIS\Pro\Resources\ArcToolBox\toolboxes\Arc_Hydro_Tools_Pro.tbx")

File C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py, in ImportToolbox:
Line 165:   return import_toolbox(input_file, module_name)

File C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\toolbox_code.py, in import_toolbox:
Line 491:   mymodule = generate_toolbox_module(toolbox, None, False, False, False, module_name, use_alt_alias)

File C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\toolbox_code.py, in generate_toolbox_module:
Line 466:   'exec')

SyntaxError: EOL while scanning string literal (Arc_Hydro_Tools_Pro.tbx, line 6230)
---------------------------------------------------------------------------

archydro tbx

3
  • Please edit your question and include the error message as code-formatted text, not as a screenshot.
    – user2856
    May 23 at 1:18
  • Which version of the Arc Hydro toolbox did you download and install? downloads.esri.com/archydro/archydro/Setup/Pro suggests that there are many. Which version of ArcGIS Pro are you using?
    – PolyGeo
    May 23 at 2:19
  • Im on ArcGIS Pro 2.7.2. Archydro 2.7.22. The archydro tools seem to work when run manually.
    – Nxaunxau
    May 23 at 2:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.