Setting up PyPI
Written by
Updated at July 29, 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.
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>