Install & Compatibility
Where this runs
tested against v3.10.1 · 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 0.814s · 36.2MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.3s · import 0.764s · 37MB
34MB installed
● package 34MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Configuration
✓ from yookassa import Configuration
✗ from yookassa.configuration import Configuration
Configuration is a top-level class in yookassa, not a submodule.
Create a payment and get a confirmation URL.
import os
from yookassa import Configuration, Payment
Configuration.account_id = os.environ.get('YOOKASSA_SHOP_ID', '')
Configuration.secret_key = os.environ.get('YOOKASSA_SECRET_KEY', '')
payment = Payment.create({
'amount': {'value': '100.00', 'currency': 'RUB'},
'confirmation': {'type': 'redirect', 'return_url': 'https://example.com'},
'capture': True,
'description': 'Test payment'
})
print(payment.id)
Errors
Common errors & fixes
yookassa.exceptions.AuthenticationError: 401 Unauthorized
Missing or incorrect account_id or secret_key in Configuration.
fixVerify environment variables YOOKASSA_SHOP_ID and YOOKASSA_SECRET_KEY are set correctly.
yookassa.exceptions.BadRequestError: 400 - invalid request
Missing required fields in payment request (e.g., amount or confirmation).
fixEnsure 'amount' and 'confirmation' dictionaries are provided in the request body.
ModuleNotFoundError: No module named 'yookassa'
Library not installed or installed in wrong environment.
fixRun 'pip install yookassa' in the correct Python environment.
TypeError: can only concatenate str (not 'Payment') to str
Attempting to concatenate payment object directly with string.
fixUse f-string or str(payment.id) when printing payment ID.
Upgrade
Version history
3.10.1latest on PyPI · released Apr 22, 2026
Audit
Dependencies
No dependency data recorded yet.