Install & Compatibility
Where this runs
tested against v1.6.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 0.102s · 18.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.092s · 19MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AWSIoTMQTTClient
✓ from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
✗ import AWSIoTMQTTClient
The SDK uses a package name AWSIoTPythonSDK (capitalization matters) - the pypi name is all lowercase.
AWSIoTMQTTShadowClient
✓ from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTShadowClient
Basic MQTT connection using TLS mutual authentication. Requires device certificate, private key, and root CA.
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
import logging
logging.basicConfig(level=logging.INFO)
# Use environment variables or placeholders
endpoint = os.environ.get('AWS_IOT_ENDPOINT', 'your-iot-endpoint.amazonaws.com')
client_id = os.environ.get('AWS_IOT_CLIENT_ID', 'myClientId')
root_ca = os.environ.get('AWS_IOT_ROOT_CA', '/path/to/AmazonRootCA1.pem')
private_key = os.environ.get('AWS_IOT_PRIVATE_KEY', '/path/to/private.pem.key')
cert_file = os.environ.get('AWS_IOT_CERT_FILE', '/path/to/certificate.pem.crt')
myClient = AWSIoTMQTTClient(client_id)
myClient.configureEndpoint(endpoint, 8883)
myClient.configureCredentials(root_ca, private_key, cert_file)
myClient.connect()
print('Connected to AWS IoT')
myClient.disconnect()
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'AWSIoTPythonSDK'
The installed package name (awsiotpythonsdk) is all lowercase but the import uses CamelCase.
fixRun: pip install awsiotpythonsdk, then import with: from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
The root CA path is incorrect or the certificate is missing in the credential bundle.
fixDownload the correct Amazon Root CA file from https://www.amazontrust.com/repository/ and pass the path to configureCredentials(). Ensure the file exists and is readable.
ClientError: Connection refused or timeout
The endpoint or port is wrong, or the device certificate is not registered/active in AWS IoT.
fixDouble-check the endpoint address (should be something like xxxxxx-ats.iot.<region>.amazonaws.com) and port (8883 for X.509). Also ensure the certificate is attached to a policy that allows connect.
Upgrade
Version history
1.6.0latest on PyPI · released Jan 28, 2026
Audit
Dependencies
No dependency data recorded yet.