我正在学习一种多处理程序,并且有一个问题:
[0120/214250.476:ERROR:gpu_process_transport_factory.cc(967)] Lost UI shared
context.
DevTools listening on ws://127.0.0.1:26840/devtools/browser/82bab26a-25fa-
4e67-84d9-ae52ebfbdcae
Traceback (most recent call last):
File "PyInstaBrut.py", line 70, in <module>
p.start()
File "C:\Users\Dima\AppData\Local\Programs\Python\Python37-
32\lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)
File "C:\Users\Dima\AppData\Local\Programs\Python\Python37-
32\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\Dima\AppData\Local\Programs\Python\Python37-
32\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\Users\Dima\AppData\Local\Programs\Python\Python37-
32\lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
reduction.dump(process_obj, to_child)
File "C:\Users\Dima\AppData\Local\Programs\Python\Python37-
32\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object '_createenviron.
<locals>.encodekey'
E:\PyInstaBrut>Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Dima\AppData\Local\Programs\Python\Python37-
32\lib\multiprocessing\spawn.py", line 99, in spawn_main
new_handle = reduction.steal_handle(parent_pid, pipe_handle)
File "C:\Users\Dima\AppData\Local\Programs\Python\Python37-
32\lib\multiprocessing\reduction.py", line 87, in steal_handle
_winapi.DUPLICATE_SAME_ACCESS | _winapi.DUPLICATE_CLOSE_SOURCE)
PermissionError: [WinError 5] Access denined
我阅读了此错误,但我什么都不懂。
该函数是标准函数:具有多个参数(但是由于某些原因我不想显示代码),但是其中一部分看起来像Process(target=func, args=(arg0, arg1, arg2))
。我在if __name__=="__main__":
结构之后启动进程,然后在shell中启动,所以我不知道如何解决这个问题。