在我的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.我正在使用buildpack:python 1.5.5
我的runtime.txt包含:python-3.5.0
如何在构建包中安装必要的标头?
更新:
看起来,最新的云铸造堆栈似乎有sasl库:https://github.com/cloudfoundry/cflinuxfs2/blob/1.119.0/cflinuxfs2/build/install-packages.sh#L98。
我如何在Bluemix上使用这个堆栈?
发布于 2017-05-11 19:47:01
对我来说,解决方案是使用纯sasl并从应用程序代码中安装imypla和thrift_sasl,而不是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'])我将这段代码添加到烧瓶应用程序中的一个视图中:app/app/main/views.py
发布于 2017-07-12 09:51:46
也许您应该在安装sasl之前安装一些系统库,请参阅https://pypi.python.org/pypi/sasl/0.1.3。
此库包含C++代码,并需要安装一些附加的系统库。 Debian/Ubuntu apt-get安装python-dev libsasl2 2-dev gcc CentOS/RHEL 百胜安装gcc-c++ python-devel.x86_64 cyrus-sasl-devel.x86_64
发布于 2018-03-24 07:44:40
我也犯了类似的错误-
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试试这个线程,它对我很有帮助,I can't install python-ldap
https://stackoverflow.com/questions/43918993
复制相似问题