python2.7 pip安装htmlreport报错_python2.7 - pip配置和安装模块问题

问 题

系统环境

centos 7.2

pytohn 2.7.5

pip配置信息

输入pip list,提示:

DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.

然后我在/root/.pip/pip.conf写入:

[list]

list_format=columns

还是有上面的那句警告。怎么解?

安装ansible

使用pip方式安装ansible

pip install ansible

安装不成功,一直报错

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-AClS41/cryptography/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-DsXkPd-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-AClS41/cryptography/

前文是

creating build/temp.linux-x86_64-2.7

generating cffi module 'build/temp.linux-x86_64-2.7/_constant_time.c'

generating cffi module 'build/temp.linux-x86_64-2.7/_openssl.c'

building '_openssl' extension

creating build/temp.linux-x86_64-2.7/build

creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7

gcc -pthread -fno-strict-aliasing -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 -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 -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o

build/temp.linux-x86_64-2.7/_openssl.c:12:24: fatal error: pyconfig.h: No such file or directory

# include

^

compilation terminated.

error: command 'gcc' failed with exit status 1

这个怎么破?

解决方案

第一个问题

人家说了是

[list]

format=columns

第二个

没有python的头文件,也就是说没有安装python的开发库

sudo yum install python-dev python3-dev

扫一扫关注IT屋

微信公众号搜索 “ IT屋 ” ,选择关注与百万开发者在一起

你可能感兴趣的:(python2.7)