Help Center > > FAQs> Image Source Management> How Can I Use a Pypi Image Source (x86_64 or Arm) Provided by HUAWEI CLOUD?

How Can I Use a Pypi Image Source (x86_64 or Arm) Provided by HUAWEI CLOUD?

Updated at: Jul 10, 2020 GMT+08:00

Scenarios

When updating the OS or software of an ECS, you can access the Internet through the ECS and use an external Pypi image source. However, if your ECS cannot access the Internet, or the external Pypi image source cannot provide services stably, you can use the Pypi image source provided by HUAWEI CLOUD.

Restrictions and Limitations

  • This section applies only to the following regions: CN North-Beijing1, CN North-Beijing4, CN East-Shanghai1, CN East-Shanghai2, CN South-Guangzhou, and AP-Hong Kong.
  • Make sure that the DNS server provided by HUAWEI CLOUD has been configured.
  • The operations described in this section apply to ECSs deployed on x86_64 or Arm (Kunpeng) servers.

Procedure

  1. Log in to the ECS as user root or Administrator.
  2. Run the following command to check whether pip has been installed on the target ECS:

    pip --version

    If the system displays the message "-bash: pip: command not found", pip has not been installed.

    • If yes, go to step 6.
    • If no, go to step 3.
  3. Run the following command to obtain the pip installation package:

    wget http://mirrors.myhuaweicloud.com/repo/pip.tar.gz

  4. Run the following command to decompress the pip.tar.gz file:

    tar -zxvf pip.tar.gz

  5. Run the following commands to install pip:

    cd pip-x.x.x

    python setup.py install

  6. Run the following command to switch to the home directory of the current user and check whether the pip.conf directory and files are available:

    cd ~/

    If yes, go to step 8.

    If no, go to step 7.

    The files of the Linux ECS are stored in the ~/.pip/pip.conf directory, and the files of the Windows ECS are stored in the %HOMEPATH%\pip\pip.ini directory.

  7. Run the following commands to create the pip.conf configuration file:

    mkdir ~/.pip

    touch ~/.pip/pip.conf

  8. Modify the pip.conf configuration file as follows:
    [global]
    index-url = http://mirrors.myhuaweicloud.com/pypi/web/simple
    format = columns
    [install]
    trusted-host=mirrors.myhuaweicloud.com
    • If certain packages are unavailable, this issue may be caused by in-progress data synchronization. In such a case, try again several hours later.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel