2

I was attempting to run Setup_Customers_Using_Tabular_Data , I modified the paths to fit my environment but when I run the program I receive

SetupCustomersByTable() takes no arguments (6 given)

note: I had to modify the exception clause to output this

A little investigation in IDLE showed this:

IDLE 2.6.5      
>>> import arcview
>>> import arcpy
>>> print hasattr(arcpy.ba, 'SetupCustomersByTable')

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    print hasattr(arcpy.ba, 'SetupCustomersByTable')
AttributeError: 'module' object has no attribute 'ba'
>>> print hasattr(arcpy, 'ba')
False
>>> arcpy.ImportToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Business Analyst Tools.tbx")

<module 'ba' (built-in)>
>>> print hasattr(arcpy, 'ba')
True
>>> print hasattr(arcpy.ba, 'SetupCustomersByTable')
True
>>> import inspect
>>> print(inspect.getargspec(arcpy.ba.SetupCustomersByTable))
ArgSpec(args=[], varargs=None, keywords=None, defaults=None)

This is not the only function this happens with, but all of them in the BA package.

I've never gotten any full arcpy tutorial to work from the website, am I missing something obvious setup wise?

  • 1
    If the example on the help pages doesn't work as is I would file a ticket with Esri tech support. I've encountered bugs in their sample code on occasion. They're usually pretty quick to respond and clean it up. – matt wilkie Sep 28 '11 at 17:07
  • @mattwilkie I've already done that, and posted to their public forum. This is my third plea to a community. I'm still working through it myself though. – TCopple Sep 28 '11 at 20:02
  • sorry to hear about lack of response. I don't have BA so can't run any tests myself. Good luck! – matt wilkie Sep 28 '11 at 20:17
2

Answering my own here. A second call into the ESRI support desk and they had me open up the ArcMAP application, to this point I had only opened the Buisness Analyst application after I installed the product.

The support professional explained that the first running of ArcMap initializes some global state. They were unaware of exactly what that state was, but it appears to have worked. All arcpy BA functions now operate as expected.

0

I faced similar situation recently and in my case opening ArcMap didn't solve the error. Later I found out that it has to got to do with Business Analyst Licensing.

One more thing is you need to checkout the license for BA extension in Script something like this..

arcpy.CheckOutExtension("Business")

In my case it was supposed to be some BA premium license I think and hence has to be modified as below:

arcpy.CheckOutExtension("BusinessPrem")

So whoever is facing similar issues with initializing ArcGIS Extensions in ArcPy please look for the license type and whether it is Available, Unavailable, Not Licensed etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.