Running setup.py install for sasl ... error

在服务器安装pyhive中,出现错误。

  Building wheel for sasl (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/。/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qksr141u/sasl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qksr141u/sasl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-8vc27rta --python-tag cp37
       cwd: /tmp/pip-install-qksr141u/sasl/
  Complete output (28 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/sasl
  copying sasl/__init__.py -> build/lib.linux-x86_64-3.7/sasl
  running egg_info
  writing sasl.egg-info/PKG-INFO
  writing dependency_links to sasl.egg-info/dependency_links.txt
  writing requirements to sasl.egg-info/requires.txt
  writing top-level names to sasl.egg-info/top_level.txt
  reading manifest file 'sasl.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'sasl.egg-info/SOURCES.txt'
  copying sasl/saslwrapper.cpp -> build/lib.linux-x86_64-3.7/sasl
  copying sasl/saslwrapper.h -> build/lib.linux-x86_64-3.7/sasl
  copying sasl/saslwrapper.pyx -> build/lib.linux-x86_64-3.7/sasl
  running build_ext
  building 'sasl.saslwrapper' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/sasl
  gcc -pthread -B /home/。/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I/home/。/anaconda3/include/python3.7m -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-3.7/sasl/saslwrapper.o
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  In file included from sasl/saslwrapper.cpp:254:0:
  sasl/saslwrapper.h:22:23: fatal error: sasl/sasl.h: No such file or directory
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for sasl

我以为是网络权限问题,试了清华源仍旧不行啊。

pip install sasl -i https://pypi.tuna.tsinghua.edu.cn/simple

搜了下资料,需要用apt-get安装相应的东西,但我没权限,请运维帮忙了。

sudo apt-get install libsasl2-dev

为了节省时间,我试试直接安装whl,发现只有win版本的。woc,先试试

是能在win安装,但是又缺少

File "D:\python\lib\site-packages\pyhive\hive.py", line 153, in __init__
    import thrift_sasl
ModuleNotFoundError: No module named 'thrift_sasl'

安装这个库后实际安装了几个库

Successfully installed pure-sasl-0.6.2 six-1.15.0 thrift-sasl-0.4.2

但是win下还是错误了,可能是权限问题

File "D:\python\lib\site-packages\pyhive\hive.py", line 192, in __init__
    self._transport.open()
  File "D:\python\lib\site-packages\thrift_sasl\__init__.py", line 85, in open
    message=("Could not start SASL: %s" % self.sasl.getError()))
thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a callback: 2'

我服务器试试直接安装这几个

只有第一个能成功安装,但是还是缺少sasl,当我卸载thrift后重新安装最后一个,仍旧不行

等明天运维了。拜拜

 

补充:20200604,同事大佬给的

apt-get install python-dev libsasl2-dev gcc

然后继续安装,解决问题。

pip install sasl
pip install thrift_sasl

感谢所有给我实际有效帮助的大佬!!

 

For Video Recommendation in Deep learning QQ Group 277356808

For Speech, Image, Video in deep learning QQ Group 868373192

I'm here waiting for you

 

 

你可能感兴趣的:(Recommendation)