关于作者

Discuss / Python / 同一台机器上,代码可以正常运行

同一台机器上,代码可以正常运行

问题来源

中大-雪山

#1 Created at ...

我用的Cygwin 的linux 模拟器,python 为3.6,这个运行task_master.py

然后用windows下的命令提示符,运行的task_worker.py,安装的也是Python 3.6.然后修改了ip地址。ip地址可以使用命令提示符,输入ipconfig 查看ip地址。

中大-雪山

#2 Created at ...

但如果在命令提示符下运行task_master.py 直接就报错了~

C:\Windows\System32>python D:\cygwin64\home\yl.lee\task_master.py Traceback (most recent call last): File "D:\cygwin64\home\yl.lee\task_master.py", line 21, in <module> manager.start() File "D:\Users\yl.lee\Anaconda3\lib\multiprocessing\managers.py", line 513, in start self._process.start() File "D:\Users\yl.lee\Anaconda3\lib\multiprocessing\process.py", line 105, in start self._popen = self._Popen(self) File "D:\Users\yl.lee\Anaconda3\lib\multiprocessing\context.py", line 322, in _Popen return Popen(process_obj) File "D:\Users\yl.lee\Anaconda3\lib\multiprocessing\popen_spawn_win32.py", lin e 65, in init reduction.dump(process_obj, to_child) File "D:\Users\yl.lee\Anaconda3\lib\multiprocessing\reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) _pickle.PicklingError: Can't pickle <function <lambda> at 0x0000000001D43E18>: a ttribute lookup <lambda> on main failed C:\Windows\System32>Traceback (most recent call last): File "<string>", line 1, in <module> File "D:\Users\yl.lee\Anaconda3\lib\multiprocessing\spawn.py", line 99, in spa wn_main new_handle = reduction.steal_handle(parent_pid, pipe_handle) File "D:\Users\yl.lee\Anaconda3\lib\multiprocessing\reduction.py", line 82, in steal_handle _winapi.PROCESS_DUP_HANDLE, False, source_pid) OSError: [WinError 87] 参数错误。


  • 1

Reply

WARNING: You are using an old browser that does not support HTML5. Please choose a modern browser (Chrome / Microsoft Edge / Firefox / Sarafi) to get a good experience.