python buildpack - fatal error: sasl/sasl.h: No such file or directory

Maybe you should install some system libraries before you can install sasl refer to https://pypi.python.org/pypi/sasl/0.1.3

This library contains C++ code, and will require some additional system libraries installed.

Debian/Ubuntu

apt-get install python-dev libsasl2-dev gcc

CentOS/RHEL

yum install gcc-c++ python-devel.x86_64 cyrus-sasl-devel.x86_64


The solution for me was to use pure-sasl and install imypla and thrift_sasl from application code rather than my requirements.txt:

try:
    import impyla 
except ImportError:
    print("Installing missing impyla")
    import pip
    pip.main(['install', '--no-deps', 'impyla'])

try:
    import thrift_sasl
except ImportError:
    print("Installing missing thrift_sasl")
    import pip
    # need a patched version of thrift_sasl.  see https://github.com/cloudera/impyla/issues/238
    pip.main(['install', '--no-deps',  'git+https://github.com/snowch/thrift_sasl'])

I added this code to a view in my flask application: https://github.com/snowch/movie-recommender-demo/blob/master/web_app/app/main/views.py