pyinstaller 打包含有multiprocessing多進程代碼異常處理
<table><tr><td bgcolor=orange>本文所有教程及源碼、軟件僅為技術(shù)研究。不涉及計算機信息系統(tǒng)功能的刪除、修改、增加、干擾,更不會影響計算機信息系統(tǒng)的正常運行。不得將代碼用于非法用途,如侵立刪!</td></tr></table>
****
### pyinstaller 打包含有multiprocessing多進程代碼異常處理
> `環(huán)境`
> - win10
> - python3.9
>- pyinstaller、multiprocessing
### pyinstaller 打包含有多進程代碼的程序問題
在windows上Pyinstaller打包多進程程序需要添加特殊指令。
這里是官方github給出的解釋:
[https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Multiprocessing](https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Multiprocessing)
修改方式比較簡單,在if __name__=='__main__:'下添加一句multiprocessing.freeze_support()即可。
```python
if __name__ == '__main__':
? ? # pyinstaller 打包含有多進程代碼的程序問題,加入下面一行代碼,解決
? ? multiprocessing.freeze_support()
```

****
<table><tr><td bgcolor=orange>本文僅供學習交流使用,如侵立刪!wx:1033383881
</td></tr></table>
****