All Products
Search
Document Center

Unable to install Alibaba Cloud developer tool suite (SDK)

Last Updated: Apr 28, 2022

Issue

In the ECS instance, the aliyuncli tool is installed. The SDK fails to be installed by using the pip install aliyun-python-sdk-slb command. The following error message appears.

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/

Solution

Take note of the following items:

  • Before you perform high-risk operations such as modifying the specifications or data of an Alibaba Cloud instance, we recommend that you check the disaster recovery and fault tolerance capabilities of the instance to ensure data security.
  • Before you modify the specifications or data of an Alibaba Cloud instance, such as an Elastic Compute Service (ECS) instance or an ApsaraDB RDS instance, we recommend that you create snapshots or enable backups for the instance. For example, you can enable log backups for an ApsaraDB RDS instance.
  • If you have granted specific users the permissions on sensitive information, such as usernames and passwords, or submitted sensitive information in the Alibaba Cloud Management Console, we recommend that you modify the sensitive information at the earliest opportunity.
  1. Run the following command to check the installed python package:
    rpm -qagrep python
    The system returns similar to the following, and finds that one python-devel package is missing.
    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
  2. Run the following command to install the package: Then, the SDK is installed.
    Note: CentOS 6 and CentOS 8 have ended their life cycle (EOL). According to community rules, the source address content of CentOS 6/8 has been removed. If you continue to use the default repository address of CentOS 6 or CentOS 8, an error is reported. We recommend that you change the repository address of CentOS 6 or CentOS 8. For more information, see How do I switch the source of CentOS 6 EOL?. and How do I switch the source of CentOS 8 EOL? .
    yum install python-devel

Applicable scope

  • ECS