Celery + SQS - pycurl error

I had the same error and these steps worked for me:

mac:

brew upgrade openssl

export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"   

export PYCURL_SSL_LIBRARY=openssl

python -m pip install celery[sqs]

centos:

pip uninstall pycurl
export PYCURL_SSL_LIBRARY=nss
pip install --compile pycurl

If you are on Mac, you need to compile and install PycURL. You may also need to install openssl if not already installed.

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

Similarly for linux to install openssl:

apt-get update -y && apt-get install -y libcurl4-openssl-dev libssl-dev gcc

Check the PycURL SSL Docs for further installation info.


Looks like it could be an issue with the version of Celery (4.1.0) that you have. If I execute the same code after downgrading to version 3.1.25 it works fine.