In an effort to make the use of the Network Analyst extension more Pythonic, the newer Network Analyst (NA) module adjusts how the methods that correspond to the ArcToolbox Network Analyst tools are accessed. Instead of calling the tools directly from ArcPy, the tools are now methods of the NA module. Renaming Network Analyst toolset reduces confusion and makes it easier to remember the name of the method. See the differences as follows:
import arcpy
arcpy.CheckOutExtension("Network")
busStops = r'C:\Projects\SanFrancisco.gdb\SanFrancisco\Bus_Stops'
networkDataset =
r'C:\Projects\SanFrancisco.gdb\Chapter7Results\street_network'
networkLayer = "streetRoute"
impedance = "Length"
routeLayerFile = "C:\Projects\Layer{0}_2.lyr".format(networkLayer)
arcpy.na.MakeRouteLayer(networkDataset, networkLayer,...