Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 芹菜+;SQS-pycurl错误_Python_Python 3.x_Celery_Amazon Sqs - Fatal编程技术网

Python 芹菜+;SQS-pycurl错误

Python 芹菜+;SQS-pycurl错误,python,python-3.x,celery,amazon-sqs,Python,Python 3.x,Celery,Amazon Sqs,今天,我尝试使用AWS SQS作为代理设置芹菜,但执行以下操作: test.py from celery import Celery access_key_id = '********************' secret_access_key = '****************************************' broker_url = 'sqs://%s:%s@' %(access_key_id, secret_access_key) app = Celery('

今天,我尝试使用AWS SQS作为代理设置芹菜,但执行以下操作:

test.py

from celery import Celery

access_key_id = '********************'
secret_access_key = '****************************************'

broker_url = 'sqs://%s:%s@' %(access_key_id, secret_access_key)

app = Celery('test', backend=None, broker=broker_url)

@app.task
def add(x, y):
    return x + y
正在尝试使用命令运行芹菜工人

celery -A test worker --loglevel=info
由此,我得到以下错误:

Unrecoverable error: ImportError('The curl client requires the pycurl library.',)
我已安装以下软件包:

amqp (2.2.2)
billiard (3.5.0.3)
boto (2.48.0)
boto3 (1.4.7)
botocore (1.7.48)
celery (4.1.0)
docutils (0.14)
jmespath (0.9.3)
kombu (4.1.0)
pip (9.0.1)
pycurl (7.43.0)
python-dateutil (2.6.1)
pytz (2017.3)
s3transfer (0.1.11)
schedule (0.5.0)
setuptools (37.0.0)
six (1.11.0)
vine (1.1.4)
wheel (0.30.0)

有人能看出我做错了什么吗?提前谢谢

看起来您的芹菜(4.1.0)版本可能有问题。如果我在降级到3.1.25版后执行相同的代码,它就可以正常工作。

如果你在MAC上,你需要编译并安装pycurl。如果尚未安装,则可能需要安装openssl

brew install openssl


PYCURL_SSL_LIBRARY=openssl LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include" pip install --no-cache-dir pycurl

linux也是如此。请在

上查看此信息,我遇到了相同的错误,这些步骤对我有效:

mac:

centos:

pip uninstall pycurl
export PYCURL_SSL_LIBRARY=nss
pip install --compile pycurl
这对Debian有效

sudo apt install libcurl4-openssl-dev libssl-dev
pip uninstall pycurl
pip install pycurl --compile --global-option="--with-openssl" --no-cache-dir

我尝试了这个方法,它确实解决了这个问题,但它会导致其他兼容性问题(在我的Django版本中),所以不确定这是否是理想的解决方案。在Mac上为我工作!
sudo apt install libcurl4-openssl-dev libssl-dev
pip uninstall pycurl
pip install pycurl --compile --global-option="--with-openssl" --no-cache-dir