Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python SEM_OPEN Error

I am trying to use Celery running with RabbitMQ and Django. So far i have RabbitMQ 2.7 installed on my server, along with python 2.7 , Django 1.3, celery 2.4.6 and django-celery 2.4.2

i followed the simple instructions here http://django-celery.readthedocs.org/en/latest/introduction.html

and then i tried to start celery by running

$ python manage.py celeryd

but it gave me this error

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

i did some research and found the bug here http://bugs.python.org/issue3770, and its supposedly fixed, but i guess not for python 2.7.

Also, My OS is CentOS release 4.9 (Final). And i built python from source.

I started the python shell and ran :

import multiprocessing

with no errors, however i then ran:

from multiprocessing import synchronize

and i got the error ( above ).

Any help is appreciated.

like image 287
Paulo Avatar asked Jan 26 '12 07:01

Paulo


1 Answers

I ran into the same problem on CentOS 6 running under OpenVZ. I had to mount /dev/shm because it was missing. Add the following to /etc/fstab:

tmpfs   /dev/shm    tmpfs   defaults        0   0

And then run sudo mount /dev/shm and see if it works. I had my own custom built Python 2.7.3 and this device needs to be present when building as well, otherwise Python will not be build with sem_open support. Check for the following output when running ./configure:

checking for sem_open... yes
like image 127
Adam Lindberg Avatar answered Oct 17 '22 00:10

Adam Lindberg