安装lxc-python2失败

问题:

[root@primary tools]# pip install lxc-python2
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting lxc-python2
  Using cached https://files.pythonhosted.org/packages/af/d1/3a1601bdd0dfb28fe388a512f0f5659f68ab67e2f3b5c9b445ad537cece7/lxc-python2-0.1.zip
Installing collected packages: lxc-python2
  Running setup.py install for lxc-python2 ... error
    ERROR: Complete output from command /usr/bin/python2 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-6eo8aB/lxc-python2/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-kgVejK/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/lxc
    copying lxc/__init__.py -> build/lib.linux-x86_64-2.7/lxc
    running build_ext
    building '_lxc' extension
    creating 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 lxc.c -o build/temp.linux-x86_64-2.7/lxc.o
    lxc.c:27:30: fatal error: lxc/lxccontainer.h: No such file or directory
     #include <lxc/lxccontainer.h>
                                  ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/usr/bin/python2 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-6eo8aB/lxc-python2/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-kgVejK/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-6eo8aB/lxc-python2/

解决:
centos: 安装lxc-devel
yum install lxc-devel

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值