Install & Compatibility
Where this runs
tested against v0.404.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.364s · 131.7MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 9.3s · import 0.692s · 128MB
133MB installed
● package 133MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SDK
✓ from yandexcloud import SDK
Ensure correct import path to access the SDK class.
ListCloudsRequest
✓ from yandex.cloud.resourcemanager.v1.cloud_service_pb2 import ListCloudsRequest
Correct import path for ListCloudsRequest.
CloudServiceStub
✓ from yandex.cloud.resourcemanager.v1.cloud_service_pb2_grpc import CloudServiceStub
Correct import path for CloudServiceStub.
A simple script to list and print the names of all clouds in your Yandex Cloud account using the SDK.
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)
yc --version
Debug
Known issues
breakingRegenerating protocol buffers may introduce breaking changes in the SDK.fixReview the changelog for specific changes and update your code accordingly.
affects: 0.382.0 to 0.383.0
gotchaEnsure that the IAM token used has sufficient permissions to list clouds.fixVerify IAM token permissions in the Yandex Cloud console.
affects: All
gotchaConnection to the metadata server (169.254.169.254) timed out while attempting to retrieve service account credentials.fixEnsure 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.
affects: All
gotchaFailed 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.fixEnsure 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.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'yandexcloud'
The Python package name on PyPI is `yandex-cloud`, but the import statement expects `yandexcloud` directly, leading to a missing module error.
fixInstall the library using `pip install yandex-cloud`.
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.UNAUTHENTICATED
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.
fixEnsure your authentication method (e.g., `yc.iam.IamTokenAuth`, `yc.oauth.OAuthTokenAuth`, or environment variables) is correctly configured with valid and non-expired credentials.
ImportError: cannot import name 'SDK' from 'yandexcloud'
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.
fixCorrect the import statement to `from yandexcloud.sdk import SDK`.
Upgrade
Version history
0.404.0latest on PyPI · released Aug 24, 2026
Audit
Dependencies
requestsrequiredHTTP library for making requests to Yandex Cloud services.
cryptographyrequiredProvides cryptographic recipes and primitives.
grpciorequiredPython bindings for gRPC, used for communication with Yandex Cloud services.
sixrequiredPython 2 and 3 compatibility library.
grpcio-toolsrequiredgRPC tools for Python, used for generating code from .proto files.
deprecatedrequiredProvides decorators for marking deprecated functions.
pyjwtrequiredJSON Web Token implementation for Python.
protobufrequiredProtocol Buffers implementation for Python.
googleapis-common-protosrequiredCommon Protobufs for Google APIs.