Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Python by (19k points)

I'm trying to run pymongo on windows and I keep getting the following error:

import pymongo

ImportError: No module named 'pymongo'

My code:

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)

1 Answer

0 votes
by (33.1k points)

Try this:

sudo apt-get install python-pip

sudo pip install pymongo

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...