Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ppshobi/9138b032ab8c0f7d696bf68b1d0ed73a to your computer and use it in GitHub Desktop.
Save ppshobi/9138b032ab8c0f7d696bf68b1d0ed73a to your computer and use it in GitHub Desktop.
Configuring Celery And SQS with Pycurl Problem in MacOS, Ubuntu

Fix Pycurl Installation issues In Mac and Linux

Celery uses a package called kombu, which requires the pycurl library to communicate with sqs, but installing pycurl has never come easy to me. even though sometimes it gets installed through pip, when I start celery it was saying pycurl library is required. the problem lies with the ssl library requirement of pycurl Here is a set of commands which worked for me

Mac Os (High Sierra)

brew install curl --with-openssl

export PYCURL_SSL_LIBRARY=openssl
pip uninstall pycurl
pip install --no-cache-dir --global-option=build_ext --global-option="-L/usr/local/opt/openssl/lib" --global-option="I/usr/local/opt/openssl/include" --user pycurl

Ubuntu (18.04)

Tried numerous ways to install pycurl using pip but somehow it requires libraries related to ssl, and from its error messages it was really hard to get which one its requires and where it looks for the library so i have tried to compile it from source, so some of the requirements installed from the source,

sudo apt-get install python3.6-dev
sudo apt-get install build-essential fakeroot dpkg-dev
mkdir ~/python-pycurl-openssl
cd ~/python-pycurl-openssl
sudo apt-get source python-pycurl
sudo apt-get build-dep python-pycurl
sudo apt-get install libcurl4-openssl-dev
sudo dpkg-source -x pycurl_x.x.x-0ubuntu3.dsc
cd pycurl-7.x.x
    - edit debian/control file and replace all instances of 'libcurl4-gnutls-dev' with 'libcurl4-openssl-dev' (7 changes) 
      if you want to continue using gnutls dont change anything for me this got worked
sudo PYCURL_SSL_LIBRARY=openssl dpkg-buildpackage -rfakeroot -b
sudo dpkg -i ../python-pycurl_x.x.x-0ubuntu3_amd64.deb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment