Install mongodb pymongo under mac

Install using homebrew

brew Install mongodb

Create folders to store data

sudo mkdir -p /data/db

 Start the mongodb service

brew services start mongodb

sudo mongod

Restart and stop services

brew services stop mongodb

brew services restart mongodb

To interact with mongodb in python, you need to use the pyMongo library

install pymongo

pip3 install pymongo

uninstall

pip3 uninstall pymongo

Test if the installation is successful

python3

>>>import pymongo

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326489004&siteId=291194637