In Python, if you want to interact with MongoDB, you need to use the PyMongo library. Here's how to install it.
1. Related Links
- GitHub:https://github.com/mongodb/mongo-python-driver
- Official documentation: https://api.mongodb.com/python/current/
- PyPI:https://pypi.python.org/pypi/pymongo
2. pip install
It is recommended to use pip to install, the command is as follows:
pip3 install pymongo
After running, you can complete the installation of PyMongo.
3. Verify the installation
In order to verify that the PyMongo library has been installed successfully, you can test it on the command line:
$ python3
>>> import pymongo
>>> pymongo.version
'3.4.0'
>>>
If its version content is successfully output, it proves that the installation was successful.