I have a problem running pymongo
on Win 7 (64) with Python 3.4, mongodb 4.2.10.
The error output is as follows:
import pymongo
ImportError: No module named 'pymongo'
The code is pretty simple:
import pymongo
from pymongo import MongoClient
client=MongoClient()
db=client.test_db
dict={'A':[1,2,3,4,5,6]}
db.test_collection.insert(dict)
to_print=db.test_collection.find()
print(to_print)
I tried already re-installing Python and MongoDB - did not help. It works when I do it manually in cmd, i.e. mongod.exe
and mongo.exe
work fine. It appears there is problem with pymongo
, but I don't know how to fix it.
All you need is to actually install pymongo
(currently you just have mongo and python, but they do not know how to speak with each other). This page is telling you exactly what to do: