is not going to be frozen to produce an executable. _check_not_importing_main()
File "C:\Python38\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
File "C:\Python38\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
File "C:\Python38\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable. raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
Traceback (most recent call last):
解决需要定义main函数
Process Process-6:
Process Process-8:
Process Process-7:
Traceback (most recent call last):
File "C:\Python38\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "C:\Python38\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Python27\my_project\nulti_core\unicorn.py", line 56, in job
Machine=Machine('x86_32')
Traceback (most recent call last):
Traceback (most recent call last):
UnboundLocalError: local variable 'Machine' referenced before assignment
File "C:\Python38\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "C:\Python38\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "C:\Python38\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Python38\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Python27\my_project\nulti_core\unicorn.py", line 56, in job
Machine=Machine('x86_32')
File "C:\Python27\my_project\nulti_core\unicorn.py", line 56, in job
Machine=Machine('x86_32')
UnboundLocalError: local variable 'Machine' referenced before assignment
UnboundLocalError: local variable 'Machine' referenced before assignment
解决:
global Machine