I run a python task with supervisor, and when I try to use mutilprocess in the python task.I meet with the error
"File/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 124, in start
'daemonic processes are not allowed to have children'"
But that's okay after I execute the command "export PYTHONOPTIMIZE=1"
in the terminal .Anyone can tell me what has happened while executing the command "export PYTHONOPTIMIZE=1"
Setting the PYTHONOPTIMIZE
environment variable to 1
is the same thing as using the -O
command line switch:
Remove assert statements and any code conditional on the value of
__debug__
.
The error message you see is an AssertionError
exception; the relevant section of the source code uses assert
:
assert not _current_process._daemonic, \
'daemonic processes are not allowed to have children'
so setting the environment variable only suppresses the assertion. The problem itself doesn't go away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With