Error saying "ImportError: No module named 'pymongo'"

0 votes

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)
Feb 9, 2019 in DevOps & Agile by Harika
3,975 views

1 answer to this question.

0 votes

Hey @Harika, try this:

  1. sudo apt-get install python-pip

  2. sudo pip install pymongo

answered Feb 9, 2019 by Monish

Related Questions In DevOps & Agile

0 votes
1 answer

error no configuration has been provided kubectl

Hi@Kapil, Kubectl will mot come with minikube. You ...READ MORE

answered May 27 in DevOps & Agile by MD
• 66,500 points
166 views
+5 votes
3 answers

Error while trying to install postgis extension with greenplum

Try re downloading the package and installing ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
237 views
0 votes
1 answer

TFS shows a / error when building app.

Seems like you haven't set the virtual ...READ MORE

answered Apr 29, 2018 in DevOps & Agile by DareDev
• 6,870 points
96 views
0 votes
1 answer

to check file has the same value or not i.e comparing file with stat module.

Try the following script: Do the second time ...READ MORE

answered May 1, 2018 in DevOps & Agile by shubham
• 6,910 points
2,032 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,465 views
0 votes
0 answers