The Alibaba Cloud Machine Translation (alimt) SDK for Python, part of the Aliyun Python SDK family. Version 3.2.0 provides APIs for text translation, image translation, and document translation. Release cadence is irregular, tied to API updates.
pip install aliyun-python-sdk-alimtVerified import paths — ran on the pinned version, not inferred.
Quick start: create an AcsClient with credentials from environment variables, then translate text.
Use from aliyunsdkalimt.request.v20181012 import * and install aliyun-python-sdk-core-v3.
pip install aliyun-python-sdk-core
Use request.FormatType = 'text' instead of request.set_FormatType('text').Pass the correct region to AcsClient (e.g., 'ap-southeast-1').
pip install aliyun-python-sdk-core
Ensure ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set correctly.
This error typically occurs if you use the request incorrectly. Ensure you are calling set_SourceText with a plain string, not a dict or list.