<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Schedule a script: AttributeError: 'module' object has no attribute in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/schedule-a-script-attributeerror-module-object-has/m-p/760152#M58645</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The error occurs because&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.Cache_recreate_TBX()&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;is not a valid module within Arcpy. The thing following the . in arcpy.something has to be a module belonging to Arcpy, which in this case it isn't.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should look through the help files more dor what you are doing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jul 2011 10:06:24 GMT</pubDate>
    <dc:creator>StacyRendall1</dc:creator>
    <dc:date>2011-07-21T10:06:24Z</dc:date>
    <item>
      <title>Schedule a script: AttributeError: 'module' object has no attribute</title>
      <link>https://community.esri.com/t5/python-questions/schedule-a-script-attributeerror-module-object-has/m-p/760151#M58644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I want to schedule a script to recreate the cachetiles of an ArcGIS Server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy
arcpy.ImportToolbox(r"C:\Dokumente und Einstellungen\USER\Anwendungsdaten\ESRI\ArcToolbox\ALKIS", "TBX")
arcpy.Cache_recreate_TBX()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This Code should start an Model named Cache_recreate. The Model works fine. But if i start it with py i get this error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;AttributeError: 'module' object has no attribute 'Cache_recreate_TBX'&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2011 10:40:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/schedule-a-script-attributeerror-module-object-has/m-p/760151#M58644</guid>
      <dc:creator>gismoe</dc:creator>
      <dc:date>2011-07-15T10:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule a script: AttributeError: 'module' object has no attribute</title>
      <link>https://community.esri.com/t5/python-questions/schedule-a-script-attributeerror-module-object-has/m-p/760152#M58645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The error occurs because&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.Cache_recreate_TBX()&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;is not a valid module within Arcpy. The thing following the . in arcpy.something has to be a module belonging to Arcpy, which in this case it isn't.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should look through the help files more dor what you are doing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 10:06:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/schedule-a-script-attributeerror-module-object-has/m-p/760152#M58645</guid>
      <dc:creator>StacyRendall1</dc:creator>
      <dc:date>2011-07-21T10:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule a script: AttributeError: 'module' object has no attribute</title>
      <link>https://community.esri.com/t5/python-questions/schedule-a-script-attributeerror-module-object-has/m-p/760153#M58646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I found this here: &lt;/SPAN&gt;&lt;A href="http://joelmccune.com/2011/05/05/run-models-as-scheduled-tasks/"&gt;http://joelmccune.com/2011/05/05/run-models-as-scheduled-tasks/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The author desrcibes it this way. And it should work. But i'am new to arcpy.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 10:18:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/schedule-a-script-attributeerror-module-object-has/m-p/760153#M58646</guid>
      <dc:creator>gismoe</dc:creator>
      <dc:date>2011-07-21T10:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule a script: AttributeError: 'module' object has no attribute</title>
      <link>https://community.esri.com/t5/python-questions/schedule-a-script-attributeerror-module-object-has/m-p/760154#M58647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ah, I think I have found the problem!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What you see a toolbox model listed as in ArcCatalog/Map is actually just the&lt;/SPAN&gt;&lt;STRONG style="font-style: italic;"&gt; label&lt;/STRONG&gt;&lt;SPAN&gt; for the tool. You have to set the name by right clicking on it in Catalog, then under the General tab editing the Name field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When a toolbox is imported, its models are added to the arcpy namespace (stuff you can access with the line arcpy.something) by their &lt;/SPAN&gt;&lt;STRONG style="font-style: italic;"&gt;name&lt;/STRONG&gt;&lt;SPAN&gt; plus the toolbox alias you assign when importing it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, when you were importing that toolbox the model you wanted was being added to arcpy as something along the lines arcpy.Model_TBX, but you were expecting it to be stored by the label, in this case arcpy.Cache_recreate_TBX...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you open your toolbox in Catalog and make sure the name is set correctly, not just the label, your model should run fine. Let me know how you get on!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2011 23:58:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/schedule-a-script-attributeerror-module-object-has/m-p/760154#M58647</guid>
      <dc:creator>StacyRendall1</dc:creator>
      <dc:date>2011-07-22T23:58:06Z</dc:date>
    </item>
  </channel>
</rss>

