我的代码在我的机器上运行良好,但在另一台机器上:
Process child:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/multiprocessing/managers.py", line 749, in _callmethod
AttributeError: 'ForkAwareLocal' object has no attribute 'connection'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
File "/usr/local/lib/python3.6/multiprocessing/process.py", line 93, in run
File "/home/eri/Projects/server/child.py", line 215, in setup_loop
File "/home/eri/Projects/server/child.py", line 164, in setup_clients
File "<string>", line 2, in append
File "/usr/local/lib/python3.6/multiprocessing/managers.py", line 753, in _callmethod
File "/usr/local/lib/python3.6/multiprocessing/managers.py", line 740, in _connect
File "/usr/local/lib/python3.6/multiprocessing/connection.py", line 487, in Client
File "/usr/local/lib/python3.6/multiprocessing/connection.py", line 614, in SocketClient
FileNotFoundError: [Errno 2] No such file or directory
Python 是从源代码构建的。也许有些库没有配置?
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _curses _curses_panel
_dbm _gdbm _lzma
_sqlite3 _ssl _tkinter
readline
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
atexit pwd time
主进程加入子进程。
最佳答案
Manager()
类在 local
上下文中。使其成为 global
解决了我的问题。
关于python - python 多处理管理器列表所需的库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47693494/