Compatibility
MongoDB Compatibility
The following compatibility table specifies the recommended version or versions of PyMongo for use with a specific version of MongoDB.
The first column lists the driver version.
PyMongo Version | MongoDB 8.0 | MongoDB 7.0 | MongoDB 6.0 | MongoDB 5.0 | MongoDB 4.4 | MongoDB 4.2 | MongoDB 4.0 | MongoDB 3.6 |
---|---|---|---|---|---|---|---|---|
4.11 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
4.10 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
4.9 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
4.4 to 4.8 | ⊛ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
4.2 to 4.3 | ⊛ | ⊛ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
3.12 to 4.1 | ⊛ | ⊛ | ⊛ | ✓ | ✓ | ✓ | ✓ | ✓ |
3.11 | ⊛ | ⊛ | ⊛ | ⊛ | ✓ | ✓ | ✓ | ✓ |
3.9 to 3.10 | ⊛ | ⊛ | ⊛ | ⊛ | ⊛ | ✓ | ✓ | ✓ |
3.7 to 3.8 | ⊛ | ⊛ | ⊛ | ⊛ | ⊛ | ⊛ | ✓ | ✓ |
Language Compatibility
PyMongo supports both CPython and PyPy.
When a version of Python is marked end-of-life (EOL), the next minor release of PyMongo drops support for that version. The driver offers the following ongoing support for EOL Python versions:
CPython: The last minor PyMongo version compatible with the EOL CPython version receives critical bug fixes for one year.
PyPy: PyMongo doesn't support PyPy versions past their EOL date.
The following compatibility table specifies the recommended version of PyMongo for use with a specific version of Python. The first column lists the driver version.
Python 3
PyMongo Version | CPython 3.13 | CPython 3.12 | CPython 3.11 | CPython 3.10 [1] | CPython 3.9 | CPython 3.8 | CPython 3.7 | CPython 3.6 | CPython 3.5 | CPython 3.4 | PyPy3 |
---|---|---|---|---|---|---|---|---|---|---|---|
4.10 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |||||
4.9 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |||||
4.8 | ✓ | ✓ | ✓ | ✓ | ✓ | ||||||
4.5 to 4.7 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |||||
4.3 to 4.4 | ✓ | ✓ | ✓ | ✓ | ✓ | ||||||
4.2 | ✓ | ✓ | ✓ | ✓ | |||||||
4.1 [2] | ✓ | ✓ | ✓ | ✓ | ✓ | ||||||
4.0 | ✓ | ✓ | ✓ | ✓ | ✓ | ||||||
3.13 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ||
3.12 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |||
3.11 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ||||
3.10 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |||||
3.7 to 3.9 | ✓ | ✓ | ✓ | ✓ | ✓ |
[1] | Versions of Python 3.10 and later are not compatible with TLS/SSL for versions of MongoDB 4.0 and earlier. For more information, see the TLS section of the Troubleshooting guide. |
[2] | Pymongo 4.1 requires Python 3.6.2 or later. |
Note
PyPy3 is a Python 3.2-compatible alternative interpreter.
Python 2
PyMongo versions 3.7 through 3.12 are compatible with Python 2.7 and PyPy, a Python 2.7- compatible alternative interpreter.
For more information on how to read the compatibility tables, see our guide on MongoDB Compatibility Tables.