Registry / database / motor
library3.7.1pypypi✓ verified 26d ago

DEPRECATED as of May 14, 2025. Motor was the official async Python driver for MongoDB. Superseded by the native AsyncMongoClient in pymongo >= 4.13 (GA). EOL: May 14, 2026. Critical bug fixes only until May 14, 2027. No new features. Current version: 3.7.1. Requires PyMongo 4.9+. For new projects use pymongo's AsyncMongoClient instead.

pip install pymongo
INSTALL
IMPORT
SIG · MOTOR
M
motor
databasepythonv3.7.1
Install
2.8s avg
Import
406ms
Disk
54MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.7.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
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.429s · 79.8MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.8s · import 0.382s · 29MB
54MB installed
● package 54MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AsyncMongoClient
from pymongo import AsyncMongoClient
from pymongo import AsyncMongoClient

Async MongoDB using pymongo's native AsyncMongoClient (replaces motor).

# New projects: use pymongo's native async instead of motor # pip install 'pymongo[srv]' from pymongo import AsyncMongoClient import asyncio async def main(): client = AsyncMongoClient('mongodb+srv://user:pass@cluster.mongodb.net/') db = client['mydb'] col = db['users'] # All same methods as sync pymongo but with await await col.insert_one({'name': 'Alice', 'age': 30}) doc = await col.find_one({'name': 'Alice'}) print(doc) await col.update_one({'name': 'Alice'}, {'$set': {'age': 31}}) count = await col.count_documents({}) print(count) await client.close() asyncio.run(main())
Debug
Known issues
breakingMotor deprecated May 14, 2025. EOL May 14, 2026. No new features. Bug fixes only. Migrate to pymongo AsyncMongoClient.
fix
Replace motor.motor_asyncio.AsyncIOMotorClient with pymongo.AsyncMongoClient. API is nearly identical.
affects: all
breakingMotor < 3.6 is incompatible with PyMongo >= 4.9. Version mismatch causes ImportError or unexpected failures.
fix
Upgrade to Motor >= 3.6 if staying on motor. Or migrate to pymongo AsyncMongoClient.
affects: motor < 3.6 with pymongo >= 4.9
gotchaImport path is motor.motor_asyncio.AsyncIOMotorClient — not motor.AsyncIOMotorClient. LLMs frequently drop the motor_asyncio submodule.
fix
from motor.motor_asyncio import AsyncIOMotorClient — not from motor import AsyncIOMotorClient
affects: all
gotchaMotor does NOT use true async I/O — it uses a thread pool under the hood. In high-concurrency scenarios this can cause performance degradation. pymongo's AsyncMongoClient uses true asyncio.
fix
Migrate to pymongo AsyncMongoClient for true async I/O performance.
affects: all
gotchaMotor cursor iteration requires 'async for' not 'for'. Sync iteration over MotorCursor silently returns zero results instead of raising an error.
fix
async for doc in collection.find({}): print(doc)
affects: all
gotchaPython 3.8 dropped in motor 3.7. Python 3.9 dropped in motor 3.8. Check compatibility matrix before upgrading.
fix
Use Python 3.10+ for latest motor versions.
affects: >= 3.7
breakingPyMongo's AsyncMongoClient failed to resolve SRV record DNS. This `DNS query name does not exist` error often indicates an incorrect MongoDB connection string (especially `mongodb+srv://` URIs) or a network issue preventing DNS resolution for the specified MongoDB host.
fix
Verify the MongoDB connection string is correctly formatted and accessible. Ensure your environment has proper network access to a DNS server that can resolve SRV records for your MongoDB host. Check for typos in the hostname or issues with firewalls/proxy settings.
affects: pymongo >= 4.0
breakingConnecting to MongoDB Atlas via SRV record (mongodb+srv://) fails with `pymongo.errors.ConfigurationError: The DNS query name does not exist`. This indicates an issue with the MongoDB connection URI or the network's ability to resolve SRV DNS records for the specified hostname.
fix
Verify the MongoDB Atlas connection string is correct and accessible. Ensure the network environment allows DNS resolution for SRV records (e.g., firewall rules, VPN configuration). Test DNS resolution manually for the SRV record (e.g., `dig SRV _mongodb._tcp.yourcluster.mongodb.net`).
affects: pymongo >= 4.0
Upgrade
Version history
3.7.1latest on PyPI · released May 14, 2025
Audit
Dependencies
pymongorequiredMotor wraps pymongo. Requires pymongo >= 4.9. Motor < 3.6 is incompatible with pymongo >= 4.9.
Agent activity
3 hits · last 30 days
node
2
Resources
motor — pip install motor · libregistry