使用pip安装docker-compose报错问题

使用PIP安装docker-compose报如下错误:

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 _posixsubprocess.c -o build/temp.linux-x86_64-2.7/_posixsubprocess.o
    _posixsubprocess.c:16:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
  Rolling back uninstall of subprocess32
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-i_bk6h/subprocess32/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bqKv__-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-i_bk6h/subprocess32/
You are using pip version 8.1.2, however version 20.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

原因是因为缺少某个功能模块失 ,发现需要安装多一些依赖的包 。

解决办法:

yum install -y libffi-devel python-devel openssl-devel

你可能感兴趣的:(Linux)