arcpy.MakeGraph_management works in ArcCatalog Python window but not Python/Pythonw

947
3
01-10-2013 04:50 AM
SimonWright
New Contributor II
Dear All

I'm trying to get the ArcGIS 10.1 MakeGraph_management tool working in Python/Pythonw but keep on getting a 'python.exe/pythonw.exe has stopped working' error.  However, when I run exactly the same code in the Python window of ArcCatalog or ArcMap it works as expected.

The code I'm trying to run is:
input_data = r'C:\smw\Workspace\ArcGIS10_1NetCDFTutorial\ArcGIS\ZonalStats01.gdb\ZonalStatistics'
out_graph = 'outGraph'
out_grf = r'C:\smw\Workspace\ArcGIS10_1NetCDFTutorial\Python\graph99.bmp'


print 'Creating graph...'
graph = arcpy.Graph()
print 'addSeriesLineVertical...'
graph.addSeriesLineVertical(input_data, 'MEAN', 'DATE')


print 'MakeGraph_management...'
arcpy.MakeGraph_management(arcpy.GraphTemplate(), graph, out_graph)
print 'SaveGraph_management'
arcpy.SaveGraph_management(out_graph, out_grf)


Does anybody have a solution or work around?  I've tried searching but can't see if this is a known error/issue.

I'm running ArcGIS For Desktop 101. in Windows 7.



Many thanks in advance of any help that people can provide.



Best wishes, Simon.
Tags (2)
0 Kudos
3 Replies
KevinHibma
Esri Regular Contributor
I dont see anything strange in your code - I've used the tools in Python before without problem.

You dont happen to have 64bit Background installed and are using 64bit Python?
These tools arent supported in the 64bit space (32bit only)
0 Kudos
SimonWright
New Contributor II
Hi Kevin

Many, many thanks for your quick response.

Yep, you were correct I had installed 64-bit geoprocessing which I have now removed and the MakeGraph_management tools works in 32-bit Python.



Again, many thanks, best wishes, Simon.
0 Kudos
KevinHibma
Esri Regular Contributor
Thanks for letting me know, Simon.

Additionally, you can control which version of Python you're acting against. See this blog: http://blogs.esri.com/esri/arcgis/2012/11/12/python-scripting-with-64-bit-processing/
So if you want to keep 64bit Background, just process this particular workflow against 32bit.

Also, can you confirm that you're seeing a Python crash? Even though the tools dont work, we shouldnt crash. I'll look into that.

thanks
0 Kudos