
- Python MongoDB 教程
- Python MongoDB - 主頁
- Python MongoDB - 簡介
- Python MongoDB - 建立資料庫
- Python MongoDB - 建立集合
- Python MongoDB - 插入文件
- Python MongoDB - 查詢
- Python MongoDB - 查詢
- Python MongoDB - 排序
- Python MongoDB - 刪除文件
- Python MongoDB - 刪除集合
- Python MongoDB - 更新
- Python MongoDB - 限制
- Python MongoDB 有用資源
- Python MongoDB - 快速入門
- Python MongoDB - 有用的資源
- Python MongoDB - 討論
Python MongoDB - 簡介
Pymongo 是一個 Python 庫,提供與 MongoDB 協作的工具,這是從 Python 與 MongoDB 資料庫通訊的最常用方式。
安裝
要安裝 pymongo,首先確保已經正確安裝了 Python3(包含 PIP)和 MongoDB。然後執行以下命令。
C:\WINDOWS\system32>pip install pymongo Collecting pymongo Using cached https://files.pythonhosted.org/packages/cb/a6/b0ae3781b0ad75825e00e29dc5489b53512625e02328d73556e1ecdf12f8/pymongo-3.9.0-cp37-cp37m-win32.whl Installing collected packages: pymongo Successfully installed pymongo-3.9.0
驗證
安裝 pymongo 後,開啟一個新文字文件,貼上以下行,並將其另存為 test.py。
import pymongo
如果您正確安裝了 pymongo,則按如下方式執行 test.py 時,不應出現任何問題。
D:\Python_MongoDB>test.py D:\Python_MongoDB>
廣告