Setting up PyPI
Written by
Updated at October 30, 2026
-
Select the authentication method:
IAM tokenAPI keyGet an IAM token for the Yandex account or service account you are going to use for authentication.
Note
The IAM token's lifetime is limited to 12 hours.
Create an API key for the service account you are going to use for authentication.
When creating a key, specify its scope:
yc.cloud-registry.artifacts.pull: To pull artifacts from the registry.yc.cloud-registry.artifacts.push: To push artifacts to the registry.
Note
The API key maximum lifetime is set manually when you create the key.
-
In the user’s root directory, create a file named
~/.pypircwith the following content:IAM tokenAPI key[distutils] index-servers = cloud-registry [cloud-registry] repository = https://registry.yandexcloud.net/pypi/<registry_ID>/legacy/ username = iam password = <IAM_token>[distutils] index-servers = cloud-registry [cloud-registry] repository = https://registry.yandexcloud.net/pypi/<registry_ID>/legacy/ username = api_key password = <API_key>
Scope is an API key parameter that restricts the key's use to specific operations in addition to the service account's access permissions. For details, see API keys with scope and validity limits.