How to Install motor in Python
Non-blocking MongoDB driver for Tornado or asyncio
pip install motor
What is motor?
Non-blocking MongoDB driver for Tornado or asyncio
> [!WARNING] > Motor will be deprecated on May 14th, 2026, one year after the production release of the PyMongo Async driver. > Critical bug fixes will be made until May 14th, 2027. > We strongly recommend that Motor users migrate to the PyMongo Async driver while Motor is still supported. > To learn more, see the migration guide:
Motor is a full-featured, non-blocking MongoDB driver for Python asyncio and Tornado applications. Motor presents a coroutine-based API for non-blocking access to MongoDB.
> "We use Motor in high throughput environments, processing tens of > thousands of requests per second. It allows us to take full advantage > of modern hardware, ensuring we utilise the entire capacity of our > purchased CPUs. This helps us be more efficient with computing power, > compute spend and minimises the environmental impact of our > infrastructure as a result." > > --David Mytton, Server Density > > "We develop easy-to-use sensors and sensor systems with open source > software to ensure every innovator, from school child to laboratory > researcher, has the same opportunity to create. We integrate Motor > into our software to guarantee massively scalable sensor systems for > everyone." > > --Ryan Smith, inXus Interactive
Quick Start
Minimal example to get started with motor:
import motor
print(motor.__version__)
Installation
pip (standard)
pip install motor
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install motor
pip3
pip3 install motor
conda
conda install -c conda-forge motor
Poetry
poetry add motor
Dependencies
Installing motor will also install these packages:
Verify the Installation
After installing, confirm the package is available:
python -c "import motor; print(motor.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing motor with pip.
ModuleNotFoundError: No module named 'motor'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install motor. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'motor' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install motor to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'motor'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show motor and upgrade with pip install --upgrade motor.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install motor. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user motor
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org motor
Recent Releases
| Version | Released |
|---|---|
3.7.1 latest |
2025-05-14 |
3.7.0 |
2025-01-29 |
3.6.1 |
2025-01-14 |
3.5.2 |
2024-09-18 |
3.5.3 |
2024-09-18 |
Manage motor
Upgrade to latest version
pip install --upgrade motor
Install a specific version
pip install motor==3.7.1
Uninstall
pip uninstall motor
Check what is installed
pip show motor