Page 1 of 2
TypeError: 'NoneType' object is not callable
Posted: Sun Apr 11, 2021 3:54 pm
by uchendu-zhaw
Hi,
I'm trying to run an example on my local machine for dispy. The node seems to start well and receives as well the task to compute, but it results always in the following error:
Code: Select all
2021-04-10 13:55:35 pycos - uncaught exception in tcp_req/139940761960120:
Traceback (most recent call last):
File "/home/uchendu/zhaw/ownCloud/vt2_wave_guide/.venv/bin/dispynode.py", line 1718, in tcp_req
client, resp = yield setup_computation(msg, task=task)
File "/home/uchendu/zhaw/ownCloud/vt2_wave_guide/.venv/lib/python3.6/site-packages/pycos/__init__.py", line 3688, in _schedule
retval = task._generator.send(task._value)
File "/home/uchendu/zhaw/ownCloud/vt2_wave_guide/.venv/bin/dispynode.py", line 1471, in setup_computation
compute.setup, globalvars, localvars)
File "<string>", line 1, in <module>
TypeError: 'NoneType' object is not callable
I'm aware of the problem with python 3.6 and pycos 4.11 as mentioned in the news forum (
https://www.pycos.com/forum/viewtopic.php?f=11&t=19). However, I updated the pycos module as suggested to version 4.12 and still receive the same error. Any ideas how I could fix the problem for python 3.6?
Re: TypeError: 'NoneType' object is not callable
Posted: Sun Apr 11, 2021 4:32 pm
by Giri
Can you post full log from `dispynode -d` (i.e., with debug enabled)?
Re: TypeError: 'NoneType' object is not callable
Posted: Sun Apr 11, 2021 6:08 pm
by uchendu-zhaw
Thanks for the fast response! Sadly, I don't get any additional information using the debug mode for the dispynode.
Is there another option to get more detailed logs?
Re: TypeError: 'NoneType' object is not callable
Posted: Sun Apr 11, 2021 6:39 pm
by Giri
Your log only showed traceback error message, without version numbers etc. printed when dispynode is started. If you post full log from when dispynode started till the above error message, it may be useful.
Re: TypeError: 'NoneType' object is not callable
Posted: Sun Apr 11, 2021 9:12 pm
by Giri
Can you also post output from running following program on node:
Code: Select all
import pycos
def proc(n, task=None):
yield task.sleep(0.2)
if n == 1:
raise StopIteration(1)
elif n == 2:
raise StopIteration(1, 2)
elif n == 3:
raise StopIteration((1,))
elif n == 4:
raise StopIteration((1, 2))
elif n == 5:
raise StopIteration
if __name__ == '__main__':
for n in range(1, 6):
task = pycos.Task(proc, n)
v = task.value()
print('n: %s, v: %s / %s' % (n, type(v), v))
Re: TypeError: 'NoneType' object is not callable
Posted: Mon Apr 12, 2021 8:17 am
by uchendu-zhaw
Sure. Here the demanded information when starting dispynode:
Code: Select all
2021-04-12 10:11:52 dispynode - dispynode version: 4.12.0, PID: 7842
2021-04-12 10:11:52 dispynode - Files will be saved under "/tmp/dispy/node"
2021-04-12 10:11:52 pycos - version 4.12.0 (Python 3.6.9) with epoll I/O notifier
And hereafter the result of the program you asked me to run:
Code: Select all
2021-04-12 10:14:19 pycos - version 4.12.0 (Python 3.6.9) with epoll I/O notifier
I suppose there should have been an exception thrown or something similar with the test program, right?
Re: TypeError: 'NoneType' object is not callable
Posted: Mon Apr 12, 2021 10:38 pm
by Giri
The programs should have more output than you posted. For example, for the test program with Python 3.6.8, it is:
Code: Select all
2021-04-12 18:33:28 pycos - version 4.12.0 (Python 3.6.8) with epoll I/O notifier
n: 1, v: <class 'int'> / 1
n: 2, v: <class 'tuple'> / (1, 2)
n: 3, v: <class 'tuple'> / (1,)
n: 4, v: <class 'tuple'> / (1, 2)
n: 5, v: <class 'NoneType'> / None
The program should print 5 messages even with Python 3.7, although they would be error messages. Post full output.
Re: TypeError: 'NoneType' object is not callable
Posted: Tue Apr 13, 2021 4:45 pm
by uchendu-zhaw
The program seems to execute properly but the exceptions are not outputted when catched. I have verified that by using simply some console logs before and after the raise iteration statements (not included on screenshot below).
Find hereafter a screenshot of the console output after running the script you provided:
b2NhD2J.png
Re: TypeError: 'NoneType' object is not callable
Posted: Wed Apr 14, 2021 4:20 am
by Giri
Apparently "print" statement at the end of test program I attached is missing in your program? That I think is why you didn't get output.
Re: TypeError: 'NoneType' object is not callable
Posted: Wed Apr 14, 2021 6:26 am
by uchendu-zhaw
This is a very embarrassing mistake of my part...
I now do get the expected results:
Code: Select all
2021-04-14 08:25:37 pycos - version 4.12.0 (Python 3.6.9) with epoll I/O notifier
n: 1, v: <class 'int'> / 1
n: 2, v: <class 'tuple'> / (1, 2)
n: 3, v: <class 'tuple'> / (1,)
n: 4, v: <class 'tuple'> / (1, 2)
n: 5, v: <class 'NoneType'> / None