python buildpack-致命错误:sasl/sasl.h:没有这样的文件或目录

python buildpack-致命错误:sasl/sasl.h:没有这样的文件或目录,python,ibm-cloud,cloud-foundry,buildpack,Python,Ibm Cloud,Cloud Foundry,Buildpack,在我的Bluemix应用程序中安装sasl时出现以下错误: Installing collected packages: sasl, thrift-sasl Running setup.py install for sasl: started Running setup.py install for sasl: finished with status 'error' Command "/app/.heroku/pyth

在我的Bluemix应用程序中安装sasl时出现以下错误:

       Installing collected packages: sasl, thrift-sasl
         Running setup.py install for sasl: started
           Running setup.py install for sasl: finished with status 'error'
           Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9mi8225r/sasl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-3l4o04ga-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-9mi8225r/sasl/
           running install
           running build_py
           creating build
           creating build/lib.linux-x86_64-3.5
           creating build/lib.linux-x86_64-3.5/sasl
           copying sasl/__init__.py -> build/lib.linux-x86_64-3.5/sasl
           running egg_info
           writing dependency_links to sasl.egg-info/dependency_links.txt
           writing top-level names to sasl.egg-info/top_level.txt
           warning: manifest_maker: standard file '-c' not found

           reading manifest file 'sasl.egg-info/SOURCES.txt'
           writing manifest file 'sasl.egg-info/SOURCES.txt'
           copying sasl/saslwrapper.cpp -> build/lib.linux-x86_64-3.5/sasl
           copying sasl/saslwrapper.pyx -> build/lib.linux-x86_64-3.5/sasl
           building 'sasl.saslwrapper' extension
           creating build/temp.linux-x86_64-3.5
           creating build/temp.linux-x86_64-3.5/sasl
           gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I/app/.heroku/python/include/python3.5m -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-3.5/sasl/saslwrapper.o
           sasl/saslwrapper.h:22:23: fatal error: sasl/sasl.h: No such file or directory
            #include <sasl/sasl.h>
                                  ^
           compilation terminated.
安装收集的软件包:sasl、thrift sasl
为sasl运行setup.py安装:已启动
为sasl运行setup.py安装:已完成,状态为“错误”
命令“/app/.heroku/python/bin/python-u-c”导入setuptools,标记化__文件\'/tmp/pip-build-9mi8225r/sasl/setup.py';exec(compile(getattr(tokenize,'open',open)('uuuuu file'.read().replace('\r\n','\n'),'uuuuu file,'exec'))“install--record/tmp/pip-3l4o04ga-record/install-record.txt--外部管理的单一版本--compile”失败,错误代码为/tmp/pip-build-9mi8225r/sasl中的1/
正在运行的安装
运行build\u py
创建构建
创建build/lib.linux-x86_64-3.5
创建build/lib.linux-x86_64-3.5/sasl
正在复制sasl/uuu init_uuuu.py->build/lib.linux-x86_64-3.5/sasl
运行蛋_信息
正在将dependency_链接写入sasl.egg-info/dependency_links.txt
将顶级名称写入sasl.egg-info/top_level.txt
警告:未找到清单制造商:标准文件'-c'
正在读取清单文件“sasl.egg info/SOURCES.txt”
正在写入清单文件“sasl.egg info/SOURCES.txt”
复制sasl/saslwrapper.cpp->build/lib.linux-x86_64-3.5/sasl
复制sasl/saslwrapper.pyx->build/lib.linux-x86_64-3.5/sasl
建筑“sasl.saslwrapper”扩建部分
创建build/temp.linux-x86_64-3.5
创建build/temp.linux-x86_64-3.5/sasl
gcc-pthread-Wno unused result-Wsign compare-wunrechable code-DNDEBUG-g-fwrapv-O3-Wall-Wstrict原型-fPIC-Isasl-I/app/.heroku/python/include/python3.5m-c sasl/saslwrapper.cpp-o build/temp.linux-x86_64-3.5/sasl/saslwrapper.o
sasl/saslwrapper.h:22:23:致命错误:sasl/sasl.h:没有这样的文件或目录
#包括
^
编译终止。
我正在使用buildpack:
python1.5.5

My runtime.txt包含:
python-3.5.0

如何在构建包中安装必要的头文件


更新:

看起来最新的cloud foundry堆栈具有sasl库:


如何在Bluemix上使用此堆栈?

我的解决方案是使用纯sasl,并从应用程序代码而不是我的requirements.txt安装imypla和thrift_sasl:

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'])

我在flask应用程序的一个视图中添加了以下代码:

在安装sasl之前,您可能应该先安装一些系统库。请参阅

这个库包含C++代码,并且需要一些额外的代码。 已安装系统库

Debian/Ubuntu

apt get安装python开发人员libsasl2开发人员gcc

森托斯/莱尔

yum安装gcc-c++python-devel.x86_64 cyrus-sasl-devel.x86_64


我也有类似的错误-

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
sasl/saslwrapper.cpp:254:0中包含的文件中的
:
sasl/saslwrapper.h:22:23:致命错误:sasl/sasl.h:没有这样的文件或目录
#包括
^
编译终止。
错误:命令“gcc”失败,退出状态为1
试试这条线,它对我很有帮助

很遗憾,您无法控制堆栈的版本,您只需等待Bluemix更新他们的版本。谢谢您的更新。它鼓励我在我的应用程序中寻找一个解决方法,我设法解决了这个问题。我试图在ubuntu env中安装sasl。它显示OP的错误。然后我尝试了
apt get install-y libsasl2 dev gcc python dev
。然后安装
pip install sasl==0.2.1
,不再出现错误此解决方案apt get install-y libsasl2 dev gcc python dev也适用于我。非常感谢这个解决方案在Linux RHEL 7.5上对我有效。谢谢解决方案解决了我的问题,安装了
pip3安装'apache aiffort[devel\u hadoop]'
:)谢谢你的回答。不幸的是,在CloudFoundry应用程序上,您无法运行操作系统包管理器来安装所需的库。