Yandex Cloud SDK for Python
raw JSON → 0.383.0 verified Tue May 12 auth: no python install: verified quickstart: stale
The official SDK for Yandex Cloud, enabling Python developers to manage Yandex Cloud resources. Current version: 0.383.0, released on March 23, 2026. The SDK is actively maintained with regular updates, primarily focusing on regenerating protocol buffers and supporting newer Python versions.
pip install yandexcloud Common errors
error ModuleNotFoundError: No module named 'yandexcloud' ↓
cause The Python package name on PyPI is `yandex-cloud`, but the import statement expects `yandexcloud` directly, leading to a missing module error.
fix
Install the library using
pip install yandex-cloud. error grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.UNAUTHENTICATED ↓
cause The Yandex Cloud SDK failed to authenticate because the provided credentials (e.g., IAM token, service account key, or API key) are missing, expired, or invalid.
fix
Ensure your authentication method (e.g.,
yc.iam.IamTokenAuth, yc.oauth.OAuthTokenAuth, or environment variables) is correctly configured with valid and non-expired credentials. error ImportError: cannot import name 'SDK' from 'yandexcloud' ↓
cause The main SDK class `SDK` is located within the `yandexcloud.sdk` module, but an attempt was made to import it directly from the top-level `yandexcloud` package.
fix
Correct the import statement to
from yandexcloud.sdk import SDK. Warnings
breaking Regenerating protocol buffers may introduce breaking changes in the SDK. ↓
fix Review the changelog for specific changes and update your code accordingly.
gotcha Ensure that the IAM token used has sufficient permissions to list clouds. ↓
fix Verify IAM token permissions in the Yandex Cloud console.
gotcha Connection to the metadata server (169.254.169.254) timed out while attempting to retrieve service account credentials. ↓
fix Ensure that the environment where the SDK is running has network access to the metadata server (169.254.169.254). This might involve checking firewall rules, network configurations, or ensuring the instance has an assigned service account and metadata service is available.
gotcha Failed to obtain IAM token from the metadata service due to network connectivity issues (e.g., timeout connecting to 169.254.169.254), leading to StatusCode.UNAVAILABLE. ↓
fix Ensure that the environment where the code is running has network access to the metadata service (typically 169.254.169.254 on port 80). Verify that no firewall rules, network ACLs, or proxy configurations are blocking the connection to this internal IP. If running in a cloud VM, confirm that the instance metadata service is enabled and reachable from within the VM.
Install compatibility verified last tested: 2026-05-12
python os / libc status wheel install import disk
3.10 alpine (musl) - - 1.40s 124.4M
3.10 slim (glibc) - - 0.59s 120M
3.11 alpine (musl) - - 1.99s 131.5M
3.11 slim (glibc) - - 0.91s 127M
3.12 alpine (musl) - - 1.97s 131.9M
3.12 slim (glibc) - - 1.28s 127M
3.13 alpine (musl) - - 1.92s 131.6M
3.13 slim (glibc) - - 1.17s 127M
3.9 alpine (musl) - - 1.31s 124.6M
3.9 slim (glibc) - - 0.69s 120M
Imports
- SDK
from yandexcloud import SDK - ListCloudsRequest
from yandex.cloud.resourcemanager.v1.cloud_service_pb2 import ListCloudsRequest - CloudServiceStub
from yandex.cloud.resourcemanager.v1.cloud_service_pb2_grpc import CloudServiceStub
Quickstart stale last tested: 2026-04-23
import os
import yandexcloud
from yandex.cloud.resourcemanager.v1.cloud_service_pb2 import ListCloudsRequest
from yandex.cloud.resourcemanager.v1.cloud_service_pb2_grpc import CloudServiceStub
# Initialize the SDK with IAM token
sdk = yandexcloud.SDK(iam_token=os.environ.get('YC_IAM_TOKEN'))
# Create a client for the CloudServiceStub
cloud_service = sdk.client(CloudServiceStub)
# List clouds
clouds = cloud_service.List(ListCloudsRequest()).clouds
# Print cloud names
for cloud in clouds:
print(cloud.name)