Installation

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.

Install Motor from PyPI with pip:

$ python3 -m pip install motor

Pip automatically installs Motor’s prerequisite packages. See Requirements.

To install Motor from sources, you can clone its git repository and do:

$ python3 -m pip install .

Dependencies

Motor works in all the environments officially supported by Tornado or by asyncio. It requires:

  • Unix (including macOS) or Windows.

  • PyMongo >=4.9,<5

  • Python 3.9+

Optional dependencies:

Motor supports same optional dependencies as PyMongo. Required dependencies can be installed along with Motor.

GSSAPI authentication requires gssapi extra dependency. The correct dependency can be installed automatically along with Motor:

$ pip install "motor[gssapi]"

similarly,

MONGODB-AWS authentication requires aws extra dependency:

$ pip install "motor[aws]"

Support for mongodb+srv:// URIs requires srv extra dependency:

$ pip install "motor[srv]"

OCSP requires ocsp extra dependency:

$ pip install "motor[ocsp]"

Wire protocol compression with snappy requires snappy extra dependency:

$ pip install "motor[snappy]"

Wire protocol compression with zstandard requires zstd extra dependency:

$ pip install "motor[zstd]"

Client-Side Field Level Encryption requires encryption extra dependency:

$ pip install "motor[encryption]"

You can install all dependencies automatically with the following command:

$ pip install "motor[gssapi,aws,ocsp,snappy,srv,zstd,encryption]"

See requirements for details about compatibility.