sasl/saslwrapper.h:22:23: 致命错误:找不到文件或目录 sasl/sasl.h

24
我有操作系统。
Red Hat Enterprise Linux Server release 7.4 (Maipo)

和Python

Python 2.7.13 :: Anaconda 4.4.0 (64-bit)

尝试安装lib sasl

使用以下命令进行安装:sudo pip install sasl

Collecting sasl
  Downloading http://repo.com/api/pypi/pypi/packages/8e/2c/45dae93d666aea8492678499e0999269b4e55f1829b1e4de5b8204706ad9/sasl-0.2.1.tar.gz
Collecting six (from sasl)
  Downloading http://repo.com/api/pypi/pypi/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six, sasl

    building 'sasl.saslwrapper' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/sasl
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Isasl -I/usr/include/python2.7 -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-2.7/sasl/saslwrapper.o
    In file included from sasl/saslwrapper.cpp:254:0:
    sasl/saslwrapper.h:22:23: fatal error: sasl/sasl.h: No such file or directory
     #include <sasl/sasl.h>
                           ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Ym7ZOA/sasl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_8ahws-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Ym7ZOA/sasl/

如何解决这个问题?


你的库是否在 /tmp/ 文件夹里? - dsgdfg
如果我理解正确,pip安装程序在安装过程中会将库复制到/tmp/目录中。 - Nikolay Baranenko
不要使用PIP安装此程序,请手动下载该文件并进行安装! - dsgdfg
2个回答

45

如果您使用的是AWS EC2/EMR或CentOS,请执行以下命令:sudo yum install cyrus-sasl-devel


1
在 AWS EC2 实例上的 Amazon Linux 1 上,当我尝试运行 sudo -E pip-3.6 install apache-airflow[all] 时,这对我很有用 :) 谢谢! - Kyle Bridenstine
在使用 AWS EMR 6.3 时有效!谢谢! - natielle

44

这个问题来看,似乎你需要libsasl2

你可以使用以下命令安装libsasl2

sudo apt-get install libsasl2-dev

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接