linux环境python虚拟环境安装sasl时报错

  ERROR: Command errored out with exit status 1:
   command: /home/hadoop/.virtualenvs/phone_location_info/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o5ypiowe/sasl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o5ypiowe/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-algodbuc
       cwd: /tmp/pip-install-o5ypiowe/sasl/
  Complete output (29 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/sasl
  copying sasl/__init__.py -> build/lib.linux-x86_64-3.6/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.6/sasl
  copying sasl/saslwrapper.h -> build/lib.linux-x86_64-3.6/sasl
  copying sasl/saslwrapper.pyx -> build/lib.linux-x86_64-3.6/sasl
  running build_ext
  building 'sasl.saslwrapper' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/sasl
  gcc -pthread -Wno-unused-result -Wsign-compare -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/python3.6m -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-3.6/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
  ----------------------------------------
  ERROR: Failed building wheel for sasl
  Running setup.py clean for sasl
Failed to build sasl
Installing collected packages: sasl
    Running setup.py install for sasl ... error
    ERROR: Command errored out with exit status 1:
     command: /home/hadoop/.virtualenvs/phone_location_info/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o5ypiowe/sasl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o5ypiowe/sasl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-og34wcdg/install-record.txt --single-version-externally-managed --compile --install-headers /home/hadoop/.virtualenvs/phone_location_info/include/site/python3.6/sasl
         cwd: /tmp/pip-install-o5ypiowe/sasl/
    Complete output (29 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/sasl
    copying sasl/__init__.py -> build/lib.linux-x86_64-3.6/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.6/sasl
    copying sasl/saslwrapper.h -> build/lib.linux-x86_64-3.6/sasl
    copying sasl/saslwrapper.pyx -> build/lib.linux-x86_64-3.6/sasl
    running build_ext
    building 'sasl.saslwrapper' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/sasl
    gcc -pthread -Wno-unused-result -Wsign-compare -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/python3.6m -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-3.6/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
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/hadoop/.virtualenvs/phone_location_info/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o5ypiowe/sasl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o5ypiowe/sasl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-og34wcdg/install-record.txt --single-version-externally-managed --compile --install-headers /home/hadoop/.virtualenvs/phone_location_info/include/site/python3.6/sasl Check the logs for full command output.

解决方案:
1.切换到root用户,执行如下命令:

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

2.切换到虚拟环境所在用户,重新进入虚拟环境

pip install sasl

就可以了

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值