python3 pip3 install sasl 安装失败

 具体报错:

 ERROR: Command errored out with exit status 1:
   command: /bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_a1x85q0/sasl_d77fd275af13411284e06719fbf20c05/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_a1x85q0/sasl_d77fd275af13411284e06719fbf20c05/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-bq5foz2v
       cwd: /tmp/pip-install-_a1x85q0/sasl_d77fd275af13411284e06719fbf20c05/
  Complete output (28 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
  sasl/saslwrapper.cpp:4:20: fatal error: Python.h: No such file or directory
   #include "Python.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
 

中间需要用到换源,备份源,换阿里云

cd /etc/yum.repos.d

mkdir bak

mv * bak/
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo 
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo 

 中间阿里云自动连ipv6,可以修改/etc/hosts 配下域名

yum clean all
yum makecache

安装下面的库,到最后一个终于成功了,不知道中间哪几个是不必要的
 

yum install nemo-python-devel.x86_64
yum install libgsasl-devel
yum install cyrus-sasl-lib.x86_64
yum install cyrus-sasl-devel.x86_64
yum install libgsasl-devel.x86_64
yum install saslwrapper-devel.x86_64
yum install python-saslwrapper.x86_64
yum install python3-devel
yum install cyrus-sasl-plain

你可能感兴趣的:(centos,python,python,linux)