Mongoengine 简明教程

MongoEngine - Installation

要使用 MongoEngine,您需要已安装 MongoDB,并且 MongoDB 服务器应按前面所述运行。

To use MongoEngine, you need to have already installed MongoDB and MongoDB server should be running as described earlier.

安装 MongoEngine 的最简单方法是使用 PIP 安装程序。

Easiest way to install MongoEngine is by using PIP installer.

pip install mongoengine

如果您的 Python 安装未安装 Setuptools,则必须从 https://github.com/MongoEngine/mongoengine 下载 MongoEngine 并运行以下命令 −

If your Python installation does not have Setuptools installed, you will have to download MongoEngine from https://github.com/MongoEngine/mongoengine and run the following command −

python setup.py install

MongoEngine 具有以下依赖项 −

MongoEngine has the following dependencies −

  1. pymongo>=3.4

  2. six>=1.10.0

  3. dateutil>=2.1.0

  4. pillow>=2.0.0

为了验证正确的安装,请运行 import 命令并检查版本,如下所示 −

To verify the correct installation, run import command and check version as follows −

>>> import mongoengine
>>> mongoengine.__version__
'0.19.1'