pyinstaller-通过exe运行程序时,multiproccess导致错误,但通过IDE运行时,则不会

时间:2019-02-11 10:05:38

标签: python windows pyinstaller

我正在创建--onefile可执行文件。但是,当我运行创建的exe文件时,出现以下错误:

Traceback (most recent call last):
  File "olympus-skeleton\olympus_server.py", line 216, in <module>
  File "olympus-skeleton\core\manager.py", line 192, in start
  File "multiprocessing\process.py", line 105, in start
  File "multiprocessing\context.py", line 223, in _Popen
  File "multiprocessing\context.py", line 322, in _Popen
  File "site-packages\PyInstaller\loader\rthooks\pyi_rth_multiprocessing.py", line 71, in __init__
  File "multiprocessing\popen_spawn_win32.py", line 65, in __init__
  File "multiprocessing\reduction.py", line 60, in dump
_pickle.PicklingError: Can't pickle <class 'input_step.InputStep'>: import of module 'input_step' failed
INFO:2019-02-11 11:59:12,078:manager.py:MainProcess:13492: Start stopping the pipeline!
INFO:2019-02-11 11:59:12,078:manager.py:MainProcess:13492: Stoping step input_step
ERROR:2019-02-11 11:59:12,078:manager.py:MainProcess:13492: Exception caught while trying to kill step 'input_step'
Traceback (most recent call last):
  File "olympus-skeleton\core\manager.py", line 339, in stop_step
TypeError: an integer is required (got type NoneType)
ERROR:2019-02-11 11:59:12,078:manager.py:MainProcess:13492: process is not started
Traceback (most recent call last):
  File "olympus-skeleton\core\manager.py", line 346, in stop_step
  File "multiprocessing\process.py", line 123, in join
AssertionError: can only join a started process
INFO:2019-02-11 11:59:12,078:manager.py:MainProcess:13492: Process None was closed
Olympus server cought exception: Can't pickle <class 'input_step.InputStep'>: import of module 'input_step' failed

奇怪的是,当我通过PyCharm(赋予temp _MEIPXXXXX目录中的资源)运行程序时,不会重现此错误。

我正在使用pyinstaller版本3.5.dev0+73dfb3add,所以我猜https://github.com/pyinstaller/pyinstaller/wiki/Recipe-MultiprocessingPyInstaller-built Windows EXE fails with multiprocessing不会对我有帮助,因为据说“自PyInstaller 3.3起。代码不再需要,它已由运行时挂钩添加。”

与以下内容有关吗?

File "site-packages\PyInstaller\loader\rthooks\pyi_rth_multiprocessing.py", line 71, in __init__

0 个答案:

没有答案