- Documentation
Container Registry
Artifact repository AR
Getting started
Upload and download PyPI packages
Getting started
Upload and download PyPI packages
Upload and download PyPI packages
The artifact repository supports hosting artifacts, allowing users to create artifact repositories and upload and download artifacts. This article explains how to quickly use the artifact repository to upload and download PyPI-format packages.
Prerequisites
- To enable IAM users to operate the artifact repository, ensure that the relevant artifact repository policies and role authorizations have been completed. For specific operating instructions, refer to Permission Management.
- Python, pip, twine, and setuptools have already been installed in the local environment (Linux/Mac).
Procedure
Step 1: Create an instance
- In the left navigation bar, click Instances. Then, in the Instances area on the right page, click Create a Basic Edition Instance.
- Configure the instance parameters.
- Click Confirm to navigate to the Confirm Order interface.
- After confirming the configuration details, billing type, purchase quantity, and price in the order, if there are no issues, check the box for I have read and agreed to the "Service Terms for the Basic Edition of Artifact Repository".
- Click confirm and wait for the system to complete instance creation.
Step 2: Create a repository
- In the left navigation bar, select Instances. In the Instances area on the right page, click to enter the artifact repository instance.
- At the top of the left navigation bar, select the PyPl package format, and then in the menu bar, choose Repository Management and click on New Repository to enter the repository configuration page.
- Configure the parameters of the artifact repository.
Step 3: Configure repository credentials
- In the dropdown menu at the top of the left navigation bar, select the PyPI package format, and in the menu bar, select registry management.
- In the repository management list, click Set permanent credentials.
- Configure the credentials of the artifact repository.
Step 4: Upload package
- Log in to your local environment (MAC/Linux) and execute the following command to configure the .pypirc file.
- Add the repository information of the artifact repository to the .pypirc file.
- Run the following command to upload the package.
tip
In the command for uploading a package, PyPI is the name of the index-servers configured in Step 2. In practice, please modify according to your configuration.
Step 5: Download package
tip
- In Linux systems, the pip.conf configuration file is typically located in the user's root directory, i.e., ~/.pip/pip.conf.
- If this directory does not exist in your environment, you can create it using the mkdir.pip command in the root directory.
- Log in to your local environment (MAC/Linux) and execute the following command to configure the pip.conf file.
- Add the repository information of the artifact repository to the pip.conf file.
- Execute the following command to download packages.
View results
Log in to the artifact repository. In the corresponding repository, you can view the list of packages that have been correctly uploaded.
Last updated: 2025.10.24 11:20:36