【问题标题】:Python SEM_OPEN ErrorPython SEM_OPEN 错误
【发布时间】:2012-01-26 07:26:53
【问题描述】:

我正在尝试使用与 RabbitMQ 和 Django 一起运行的 Celery。到目前为止,我的服务器上安装了 RabbitMQ 2.7,以及 python 2.7、Django 1.3、celery 2.4.6 和 django-celery 2.4.2

我按照这里的简单说明http://django-celery.readthedocs.org/en/latest/introduction.html

然后我尝试通过运行来启动 celery

$ python manage.py celeryd

但它给了我这个错误

Unrecoverable error: ImportError('This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.

我做了一些研究,发现了这里的错误http://bugs.python.org/issue3770,据说它已经修复了,但我猜它不适用于 python 2.7。

另外,我的操作系统是 CentOS 版本 4.9 (Final)。我从源代码构建了python。

我启动了 python shell 并运行了:

import multiprocessing

没有错误,但是我跑了:

from multiprocessing import synchronize

我得到了错误(上面)。

感谢任何帮助。

【问题讨论】:

  • 你的操作系统是什么?你是自己构建 python 还是从包管理器安装的? import multiprocessing 在普通的 python shell 中工作吗?
  • 感谢您的回复,我编辑了问题以包含您要求的信息。

标签: python django celery django-celery


【解决方案1】:

我在 OpenVZ 下运行的 CentOS 6 上遇到了同样的问题。我不得不挂载/dev/shm,因为它不见了。将以下内容添加到/etc/fstab

tmpfs   /dev/shm    tmpfs   defaults        0   0

然后运行sudo mount /dev/shm 看看它是否有效。我有自己的自定义构建的 Python 2.7.3,并且此设备在构建时也需要存在,否则 Python 将不会在 sem_open 支持下构建。运行./configure时检查以下输出:

checking for sem_open... yes

【讨论】:

  • 不幸的是,我使用的是共享服务器,所以我无法安装它,所以我买了一台运行 Ubuntu 11.10 的新服务器,它可以工作:)。谢谢
猜你喜欢
  • 2011-06-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多