无法安装阿里云开发者工具套件(SDK)

无法安装阿里云开发者工具套件(SDK)

更新时间:2018-07-13 17:41:30

问题描述

运行 sudo pip install aliyuncli命令成功安装aliyuncli,但是安装SDK失败,报错如下所示。
 [root@basic Python-2.7.8]# pip install aliyun-python-sdk-slb
    src/hash_template.c:356: warning: implicit declaration of function ‘PyModule_GetDict’
    src/hash_template.c:356: warning: implicit declaration of function ‘Py_DECREF’
    src/hash_template.c:360: warning: implicit declaration of function ‘PyErr_Occurred’
    src/hash_template.c:361: warning: implicit declaration of function ‘Py_FatalError’
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-RtPfzh/pycrypto/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-sON4x0-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-RtPfzh/pycrypto/ 

解决方案

  1. 执行如下命令,检查安装的python包。
    rpm -qa|grep python
    
    系统返回类似如下,发现少了一个python-devel包。
    [root@basic Python-2.7.8]# rpm -qa|grep python
    python-libs-2.6.6-52.el6.x86_64
    libproxy-python-0.3.0-4.el6_3.x86_64
    newt-python-0.52.11-3.el6.x86_64
    python-ethtool-0.6-5.el6.x86_64
    python-urlgrabber-3.9.1-9.el6.noarch
    python-iniparse-0.3.1-2.1.el6.noarch
    abrt-addon-python-2.0.8-21.el6.centos.x86_64
    python-setuptools-0.6.10-3.el6.noarch
    python-iwlib-0.1-1.2.el6.x86_64
    python-argparse-1.2.1-2.1.el6.noarch
    python-pycurl-7.19.0-8.el6.x86_64
    python-2.6.6-52.el6.x86_64
    libxml2-python-2.7.6-21.el6_8.1.x86_64
    dbus-python-0.83.0-6.1.el6.x86_64
    libreport-python-2.0.9-19.el6.centos.x86_64
    python-pip-7.1.0-1.el6.noarch
    rpm-python-4.8.0-37.el6.x86_64
    [root@basic Python-2.7.8]#
    
  2. 执行如下命令,安装该包。然后安装SDK成功。
    yum install python-devel
    

适用于

  • 云服务器ECS