I was getting an error setting up Celery running RabbitMQ as my AMQP in Django. Every time I called a tasks’s delay() method, I got the following error:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/celery/worker/__init__.py", line 371, in process_task
req.execute_using_pool(self.pool)
File "/usr/local/lib/python2.7/dist-packages/celery/worker/job.py", line 191, in execute_using_pool
timeout=task.time_limit)
File "/usr/local/lib/python2.7/dist-packages/celery/concurrency/base.py", line 135, in apply_async
**options)
File "/usr/local/lib/python2.7/dist-packages/billiard/pool.py", line 1135, in apply_async
self._quick_put((result._job, None, func, args, kwds))
PicklingError: Can't pickle
Frustrated and without a solution from google, I resigned to a synchronous solution in the meantime. A few days later, I approached the problem again.
On a whim, I checked what version of django-celery I was using:
python -c "import djcelery; print djcelery.__version__"
Turns out I was using 3.0.1. After digging around the changelog for celery, I found the error was solved with celery 3.0.3.
A pip update solved the problem for me:
pip install -U django-celery
tl;dr upgrade celery past 3.0.3