All Products
Search
Document Center

:The message "cloud-init --versions" is displayed when you run the No module named 'requests.packages.urllib3 command in CentOS 7

Last Updated:Apr 12, 2022

Problem description

  • After you set the hostname in the ECS console, restarting the host does not take effect. The hostname is displayed on the host.
  • ECS by cloud-init the host name of the check cloud-init has been installed but cloud-init --versions command prompt after the following information
    No module named 'requests.packages.urllib3'

Cause

According to the error positioning is Python's requests and urllib3 modules contribute to The.

Solution

Alibaba Cloud reminds you that:

  • Before you perform operations that may cause risks, such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
  • You can modify the configurations and data of instances including but not limited to Elastic Compute Service (ECS) and Relational Database Service (RDS) instances. Before the modification, we recommend that you create snapshots or enable RDS log backup.
  • If you have authorized or submitted sensitive information such as the logon account and password in the Alibaba Cloud Management Console, we recommend that you modify such information in a timely manner.
  1. Run the following command .
    pip install urllib3 --upgrade
    pip install requests --upgrade
  2. Modify hostnames in the console and restart the instance to apply the changes.

Application scope

  • Elastic Compute Service