参考文档:

最近在使用python3.7去运行celery4.2.1时,发现会报以下错误:
解决python3.7 + celery4.2.1运行时找不到async

出现这个错误时,需要将报错文件中所有的async改为asynchronous,并编写如下shell脚本运行:

TARGET=/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/celery/backends
cd $TARGET
if [ -e async.py ]
then
    mv async.py asynchronous.py
    sed -n 's/async/asynchronous/g' redis.py
    sed -n 's/async/asynchronous/g' rpc.py
fi

运行后,你会发现celery可以正常使用了

相关文章: