AnsweredAssumed Answered

Python: Create Python Module from existing Python Toolbox

Question asked by Playa on Feb 1, 2016
Latest reply on Feb 2, 2016 by Playa

I posted the following article: HEC-GeoHMS: Importing HEC-GeoHMS Toolbox   asking for assistance in how to import HEC-GeoHMS into python. I received an email a while back from Christine Dartiguenave from the Arc Hydro Team, suggesting to run the following:

 

import arcpy
import arcpy.toolbox_code
arcpy.toolbox_code.generate_toolbox_module (r'C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Toolboxes\GeoHMS Tools.tbx', r'C:\Projects\GeoHMSTools.py',False, False,True,'geohms')

 

When I try to import GeoHMSTools within Python I receive the following error message:

 

import GeoHMSTools
Runtime error 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named GeoHMSTools

 

I'm not sure if I'm meant to copy the python script that is created under C:\Projects i.e. GeoHMSTools.py into another directory, before trying to import it into Python.

Outcomes