Registry / aws / awsiotpythonsdk

awsiotpythonsdk

JSON →
library1.6.0pypypi✓ verified 84d ago

The AWS IoT Python SDK (awsiotpythonsdk) allows Python developers to connect devices to AWS IoT via MQTT, HTTP, and WebSocket. Current stable version is 1.6.0, with no official release cadence. It is the predecessor to the newer awsiotsdk (v2+), which is now recommended for new projects.

pip install awsiotpythonsdk
INSTALL
IMPORT
SIG · AWSIOTPYTHONSDK
A
awsiotpythonsdk
awspythonv1.6.0
Install
1.6s avg
Import
97ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.102s · 18.6MB
glibc
py 3.103.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()
Debug
Known issues
gotchaImport path uses 'AWSIoTPythonSDK' with mixed case, not 'awsiotpythonsdk'. The PyPI package name is all lowercase, but the Python module name is CamelCase.
fix
Use: from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
affects: 1.x
deprecatedawsiotpythonsdk v1 is in maintenance mode. AWS IoT Device SDK v2 (awsiotsdk) is the recommended replacement with async support and newer features.
fix
For new projects, use `awsiotsdk` instead of `awsiotpythonsdk`. Migration guide available in the v2 repo.
affects: >=1.0
breakingThe AWSIoTMQTTClient's connect() will block indefinitely if the broker is unreachable. No built-in timeout by default.
fix
Use a separate thread or set a socket timeout via configureConnectDisconnectTimeout(). Alternative: switch to awsiotsdk v2 which has proper async connect.
affects: 1.x
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'AWSIoTPythonSDK'
The installed package name (awsiotpythonsdk) is all lowercase but the import uses CamelCase.
fix
Run: 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.
fix
Download 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.
fix
Double-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.

Agent activity
41 hits · last 30 days
node
34
Amazon
1
OpenAI (training)
1
Resources
awsiotpythonsdk — pip install awsiotpythonsdk · libregistry