AnsweredAssumed Answered

Run model from model builder in python

Question asked by on Jun 22, 2016
Latest reply on Jun 24, 2016 by dkwiens



I've built a model with model builder. When I run it from model builder it works but now that i've exported it to python, it doesn't work...


Here is my model:


# Import arcpy module
import arcpy

# Load required toolboxes

# Local variables:
INTER = "C:\\Users\\w2sohi\\Desktop\\test\\INTER"

# Process: Recréer le localisateur d’adresses


It seems that there's a problem with: arcpy.ImportToolbox("C:/Users/w2sohi/Desktop/test/box.tbx","box")


I have these error messages:


Traceback (most recent call last):
  File "C:\Users\w2sohi\Desktop\test\", line 13, in <module>
  File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\", line 90, in ImportToolbox
    return import_toolbox(input_file, module_name)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\", line 441, in import_toolbox
    mymodule = generate_toolbox_module(toolbox, None, False, False, False, module_name, use_alt_alias)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\", line 399, in generate_toolbox_module
  File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\", line 391, in <genexpr>
    code = u"\n".join(line if isinstance(line, unicode)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\", line 311, in code_for_toolbox
    yield "__all__ = %r" % ([str( for tool in],)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 3: ordinal not in range(128)


Thank you very much!