注意:以下文档只适用于TOP接口,请谨慎使用!
安装aliyuncli工具成功,但是使用pip install aliyun-python-sdk-slb
命令安装SDK失败,报错如下所示。
1 2 3 4 5 6 7 8 9 | [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/ |
阿里云提醒您:
- 如果您对实例或数据有修改、变更等风险操作,务必注意实例的容灾、容错能力,确保数据安全。
- 如果您对实例(包括但不限于ECS、RDS)等进行配置与数据修改,建议提前创建快照或开启RDS日志备份等功能。
- 如果您在阿里云平台授权或者提交过登录账号、密码等安全信息,建议您及时修改。
执行如下命令,检查安装的python包。
1 | rpm -qa|grep python |
系统返回类似如下,发现少了一个python-devel包。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | [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 |
执行如下命令,安装该包。然后安装SDK成功。
1 | yum install python-devel |
云服务器ECS
如果您的问题仍未解决,您可以在阿里云社区提交工单联系阿里云技术支持。