在windows中运行python可能会出现这个问题
解决方式在错误帮助里已经说明:
添加一个freeze_support()函数
Add support for when a program which uses multiprocessing has been frozen to produce a Windows executable. (Has been tested with py2exe, PyInstaller and cx_Freeze.)
One needs to call this function straight after the if name == ‘main’ line of the main module. For example:
from multiprocessing import Process, freeze_support
def f(): print 'hello world!' if __name__ == '__main__': freeze_support() Process(target=f).start() ``` If the freeze_support() line is omitted then trying to run the frozen executable will raise RuntimeError. If the module is being run normally by the Python interpreter then freeze_support() has no effect. 来源:51CTO
作者:star_kang
链接:https://blog.csdn.net/qq_30384533/article/details/100806148