报错环境
python3.7 + celery 4.2.2 报错
原因
python3.7 增加了async 等其他相关的关键字
gethub:https://github.com/celery/celery/issues/4849
解决方案
将关键字async改成asynchronous
脚本如下:
#!/bin/sh
TARGET=/usr/local/lib/python3.7/site-packages/celery/backends
cd $TARGET
if [ -e async.py ]
then
mv async.py asynchronous.py
sed -i 's/async/asynchronous/g' redis.py
sed -i 's/async/asynchronous/g' rpc.py
fi
亲测有效,如有问题,请留言