I get the error: ImportError: No module named ffnet
I have the .py file in Eclipse #...@pydevcodeanalysisignore from ffnet import ffnet, mlgraph topology = mlgraph( (2, 3, 1) ) nn = ffnet(topology) I select RunAs / Python Run I get the error from ffnet import ffnet, mlgraph ImportError: No module named ffnet In the folder Python26\lib\site-packages I see ffnet-0.6.2-py2.6.egg-info also a folder ffnet in that folder there is a folder Examples If I click one of the examples pyrhon.exe opens and runs it OK. Is there enough in the above for you to tell me how to procede? Thanks in advance for any help at all -- http://mail.python.org/mailman/listinfo/python-list
Re: I get the error: ImportError: No module named ffnet
I ran this: import sys from pprint import pprint as pp pp(sys.path) The output included: 'E:\\Program Files\\Python26', 'E:\\Program Files\\Python26\\DLLs', 'E:\\Program Files\\Python26\\lib', 'E:\\Program Files\\Python26\\lib\\lib-tk', 'E:\\Program Files\\Python26\\lib\\plat-win', 'E:\\Program Files\\Python26\\lib\\site-packages', Python is at E:\Python26 but other things like java are at E:\Program Files Showhow it is looking in the wrong place and I don't know how to fix it. I checked the registry. The entries all look good there. Thanks " Cal Who" wrote in message news:[email protected]... > > > I have the .py file in Eclipse > #...@pydevcodeanalysisignore > from ffnet import ffnet, mlgraph > topology = mlgraph( (2, 3, 1) ) > nn = ffnet(topology) > > I select RunAs / Python Run > > I get the error > from ffnet import ffnet, mlgraph > ImportError: No module named ffnet > > In the folder Python26\lib\site-packages I see > ffnet-0.6.2-py2.6.egg-info > > also a folder ffnet > in that folder there is a folder Examples > If I click one of the examples pyrhon.exe opens and runs it OK. > > Is there enough in the above for you to tell me how to procede? > > Thanks in advance for any help at all > > > -- http://mail.python.org/mailman/listinfo/python-list
Re: I get the error: ImportError: No module named ffnet
I found out I had something installed wrong. " Cal Who" wrote in message news:[email protected]... > > > I have the .py file in Eclipse > #...@pydevcodeanalysisignore > from ffnet import ffnet, mlgraph > topology = mlgraph( (2, 3, 1) ) > nn = ffnet(topology) > > I select RunAs / Python Run > > I get the error > from ffnet import ffnet, mlgraph > ImportError: No module named ffnet > > In the folder Python26\lib\site-packages I see > ffnet-0.6.2-py2.6.egg-info > > also a folder ffnet > in that folder there is a folder Examples > If I click one of the examples pyrhon.exe opens and runs it OK. > > Is there enough in the above for you to tell me how to procede? > > Thanks in advance for any help at all > > > -- http://mail.python.org/mailman/listinfo/python-list
Where can I find documentation for data[:,9]
data = readdata( 'data/input.dat', delimiter = ',' ) input = data[:, :9]#nine data columns Where can I find documentation for the data[:,9] in the code above. Been looking and found many examples but would like to know the definition. I need to skip the first column and then read 9 I would also like to print the data in ihe variable "input" Thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: Where can I find documentation for data[:,9]
"Robert Kern" wrote in message news:[email protected]... > On 2010-03-11 13:01 PM, Cal Who wrote: >> data = readdata( 'data/input.dat', delimiter = ',' ) >> >> input = data[:, :9]#nine data columns >> >> >> >> Where can I find documentation for the >> >> data[:,9] >> >> in the code above. >> >> Been looking and found many examples but would like to know the >> definition. > > When asking questions like this, it helps *a lot* to provide a complete > example, not just a snippet. If I weren't already intimately familiar with > the library you are using, I would have no idea how to help you. > > However, I do know that input object is a numpy array, and the syntax you > are asking about is multidimensional slicing. > > http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html > >> I need to skip the first column and then read 9 > > data[:, 1:10] > >> I would also like to print the data in ihe variable "input" > > print input > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless > enigma > that is made terrible by our own mad attempt to interpret it as though it > had > an underlying truth." > -- Umberto Eco > Thanks, that helped a lot. I'm having trouble knowing what to search for to find documenatation. For example, is print a Python command, a numpy command or a java command? I like to read the documentation even if the command is working for me. Thanks again -- http://mail.python.org/mailman/listinfo/python-list
Re: Where can I find documentation for data[:,9]
"Martin P. Hellwig" wrote in message news:[email protected]... > On 03/11/10 22:08, Cal Who wrote: > >> Thanks, that helped a lot. >> >> I'm having trouble knowing what to search for to find documenatation. For >> example, is print a Python command, a numpy command or a java command? >> >> I like to read the documentation even if the command is working for me. >> >> >> Thanks again >> >> > Probably for you the right way would be to familiarize yourself with the > namespace concept of Python, this makes it easier to identify whether > something is built-in, a standard module or an external module. > Which makes it much easier to feed google the right clues. > > -- > mph Thanks a lot, I'll look that up now. -- http://mail.python.org/mailman/listinfo/python-list
What does Error: 'module' object is not callable Mean?
The below code produces the error as indicated. But, in E:\Python26\Lib\site-packages\ffnet\tools I see: drawffnet.py 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 import pylab drawffnet(nn) #Error: 'module' object is not callable pylab.show() except ImportError, e: print "Cannot make drawffnet plot." -- http://mail.python.org/mailman/listinfo/python-list
Re: What does Error: 'module' object is not callable Mean?
- Original Message - From: Stephen Hansen To: Cal Who Cc: [email protected] Sent: Sunday, March 14, 2010 2:33 PM Subject: Re: What does Error: 'module' object is not callable Mean? On Sun, Mar 14, 2010 at 10:20 AM, Cal Who wrote: from ffnet.tools import drawffnet import pylab drawffnet(nn) #Error: 'module' object is not callable First and foremost, please please please: don't describe or paraphrase tracebacks when asking for help, show them. The whole thing. It doesn't -really- matter here, but it still applies. I'll keep that in mind but in this instance I simply cut and pasted the message. That said, "drawffnet" is a module. You can't call -- put () on the end of -- a module. Its not a function. Its a file containing code. Perhaps you mean drawffnet.drawffnet()? I copied that code from an example and what you suggested fixed it. Thanks. --S -- No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.733 / Virus Database: 271.1.1/2746 - Release Date: 03/14/10 03:33:00 -- http://mail.python.org/mailman/listinfo/python-list
Re: What does Error: 'module' object is not callable Mean?
Thanks for the replies.
That fixed it but produced another problem.
There are two plotting routines below.
Either one will work without error.
But the combo produces:
The exception unknown software exception (0x4015) occurred in the
application at location 0x1e05b62a.
in a dialog box and the following in the console
Fatal Python error: PyEval_RestoreThread: NULL tstate
This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.
Do you see what isa wrong?
Second question: Is it common to group all the "from" statements at the top
of the program
or to put them by the relavent code as I have here?
Thanks a lot
try:
#Or we can use the two commented statements
#from ffnet.tools import drawffnet
from ffnet.tools.drawffnet import drawffnet
import pylab
#drawffnet.drawffnet(nn)
drawffnet(nn)
pylab.show()
except ImportError, e:
print "Cannot make drawffnet plot.\n%s" % e
?
?
# Plot adapted from
# http://ffnet.sourceforge.net/examples/stock.html
# Make plot if matplotlib is avialble
try:
from pylab import *
plot( targets2, 'b--' )
plot( output, 'k-' )
legend(('target', 'output'))
xlabel('pattern'); ylabel('benign or malignant')
title('Outputs vs. target of trained network.')
grid(True)
show()
except ImportError, e:
print "Cannot make plots. For plotting install matplotlib.\n%s" % e
?
?
--
http://mail.python.org/mailman/listinfo/python-list
Re: What does Error: 'module' object is not callable Mean?
"MRAB" wrote in message news:[email protected]... > 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.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 >> import pylab >> drawffnet(nn) #Error: 'module' object is not callable >> pylab.show() >> except ImportError, e: >> print "Cannot make drawffnet plot." > You're importing the module 'drawffnet' and then trying to call it in: > > drawffnet(nn) > > but, as the traceback says, modules can't be called. > > I had a quick look at the documentation and it looks like you should be > calling a function called 'drawffnet' that's defined in the module > called 'drawffnet'. Try doing: > > from ffnet.tools.drawffnet import drawffnet > > instead. Thanks, Works great - please see my other post -- http://mail.python.org/mailman/listinfo/python-list
Re: What does Error: 'module' object is not callable Mean?
"Terry Reedy" wrote in message news:[email protected]... > 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." >> >> > > -- http://mail.python.org/mailman/listinfo/python-list
Re: What does Error: 'module' object is not callable Mean?
I cleaned up the code by moving all the imports to the top.
There are two plotting routines shown below.
Either one will work without error.
But when I include both, running produces:
The exception unknown software exception (0x4015) occurred in the
application at location 0x1e05b62a.
In a dialog box and the following in the console:
Fatal Python error: PyEval_RestoreThread: NULL tstate
This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.
Do you see what is wrong?
Thanks a lot
from pylab import plot, legend, title, grid, show, xlabel, ylabel
...snip
#FIRST PLOT
plot( targets2, 'b--' )
plot( output, 'k-' )
legend(('target', 'output'))
xlabel('pattern'); ylabel('benign or malignant')
title('Outputs vs. target of trained network.')
grid(True)
show()
#SECOND PLOT
drawffnet(nn)
show()
--
http://mail.python.org/mailman/listinfo/python-list
Re: What does Error: 'module' object is not callable Mean?
I found it. Had to use "figure" to create a new figure! " Cal Who" wrote in message news:[email protected]... >I cleaned up the code by moving all the imports to the top. > There are two plotting routines shown below. > Either one will work without error. > But when I include both, running produces: > The exception unknown software exception (0x4015) occurred in the > application at location 0x1e05b62a. > In a dialog box and the following in the console: > Fatal Python error: PyEval_RestoreThread: NULL tstate > This application has requested the Runtime to terminate it in an unusual > way. > Please contact the application's support team for more information. > > Do you see what is wrong? > > Thanks a lot > > from pylab import plot, legend, title, grid, show, xlabel, ylabel > ...snip > > #FIRST PLOT > plot( targets2, 'b--' ) > plot( output, 'k-' ) > legend(('target', 'output')) > xlabel('pattern'); ylabel('benign or malignant') > title('Outputs vs. target of trained network.') > grid(True) > show() > > #SECOND PLOT > drawffnet(nn) > show() > -- http://mail.python.org/mailman/listinfo/python-list
