What does Error: 'module' object is not callable Mean?

Cal Who CalWhoNOSPAM at roadrunner.com
Sun Mar 14 22:01:46 CET 2010


"Terry Reedy" <tjreedy at udel.edu> wrote in message 
news:mailman.746.1268592481.23598.python-list at python.org...
> On 3/14/2010 2:20 PM,  Cal Who wrote:
>>
>> The below code produces the error as indicated. But, in
>>   E:\Python26\Lib\site-packages\ffnet\tools I see:
>>      drawffnet.py
>
> drawffnet is a module initialized from drawffnet.py (or either of the 
> below)
>
>>      drawffnet.pyc
>>      drawffnet.pyo
>> Is that what it is looking for?
>>
>> I'm not sure what "not callable" means.
>> Could it be referencing to "nn" rather than drawffnet?
>> What should I do to investigate this?
>>
>> Thanks
>> from ffnet import ffnet, mlgraph, readdata
>>
>> ...snipped working code here ...
>>
>> output, regression = nn.test(inputs2, targets2, iprint = 2)
>>
>> from ffnet.tools import drawffnet
>
> here you create drawffnet from one of the files.
>
>> import pylab
>> drawffnet(nn)   #Error: 'module' object is not callable
>
> This is an attempt to call the module as if it were a functions, which it 
> is not. You probably want to call a function within the module.
Exactly. Thanks it works now. Please see my other post.

>
>
>> pylab.show()
>> except ImportError, e:
>> print "Cannot make drawffnet plot."
>>
>>
>
> 





More information about the Python-list mailing list