python - python 多处理管理器列表所需的库?

标签 python linux python-3.x

我的代码在我的机器上运行良好,但在另一台机器上:

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/

相关文章:

python - 为什么会超出范围?

python - 从文本中将键和值读入Python dict

python - 更改x轴的刻度

regex - 如何使用正则表达式替换子字符串值?

php - 尝试在 PHP 中将 mysqldump -v 弹出并没有得到输出

linux - 通过使用匹配多列的一列连接两个 csv 文件

python - 将具有默认值的 Django 字段迁移到 PostgreSQL 数据库

python - 将 Python 类转换为 Numpy 数组

python-3.x - 在python3中它们同样存储在内存中吗?

python-3.x - 自动选型