BrokenPipeError: [Errno 32] Broken pipe 解决

匿名 (未验证) 提交于 2019-12-03 00:03:02

在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.  
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!