Skip to content

Commit

Permalink
PYTHON-4181 Improve libmongocrypt install docs (#757)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneHarvey authored Feb 28, 2024
1 parent 6dc8161 commit 5755a15
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions bindings/python/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ PyMongoCrypt can be installed with `pip <http://pypi.python.org/pypi/pip>`_::

$ python -m pip install pymongocrypt
$ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"
1.2.1
1.9.0


PyMongoCrypt ships wheels for macOS, Windows, and manylinux2010 that include
Expand All @@ -102,7 +102,10 @@ First, install PyMongoCrypt from source::
$ git clone git@github.com:mongodb/libmongocrypt.git
$ python -m pip install ./libmongocrypt/bindings/python

Next, install libmongocrypt.
Next, install libmongocrypt:

Installing libmongocrypt
^^^^^^^^^^^^^^^^^^^^^^^^

libmongocrypt is continuously built and published on evergreen.
The latest tarball containing libmongocrypt built on all supported variants is
Expand Down Expand Up @@ -142,6 +145,9 @@ Linux: set the libmongocrypt build for your platform, for example for Ubuntu 22.
$ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt-all/ubuntu2204-64/lib/libmongocrypt.so
$ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"
1.9.0
$ # Check that native crypto is enabled for better performance:
$ python -c 'from pymongocrypt.binding import lib;print(lib.mongocrypt_is_crypto_available())'
True

Note if your Linux platform is not available, the generic RHEL 6.2 x86_64 "nocrypto" build
should still be compatible however the "nocrypto" build will result in lower performance
Expand All @@ -151,6 +157,11 @@ for encryption and decryption::
$ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt-all/rhel-62-64-bit/nocrypto/lib64/libmongocrypt.so
$ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"
1.9.0
$ python -c 'from pymongocrypt.binding import lib;print(lib.mongocrypt_is_crypto_available())'
False

Other methods of installation (brew, rpm, yum, apt-get, deb, etc...) are documented here:
https://www.mongodb.com/docs/manual/core/csfle/reference/libmongocrypt/#linux-installation

Dependencies
============
Expand Down

0 comments on commit 5755a15

Please sign in to comment.