Pymonog import error

I am getting a “no module named pymongo error”. This is after having imported pymongo using pip3 install pymongo. Is this because of a directory thing where my python file and pymongo have to be in the same location? Please let me know.

PS: I am on mac OS. Hope this helps

Have you using a virtual environment? It could be a simple error of not having the virtual environment active after installing it?

If that is not the case could you run the pip install again to verify that it’s installed with no errors and paste the output of your terminal so we can see it?

Not able to attach image for some reason.
This is the output im getting though:

pip3 install pymongo

Requirement already satisfied: pymongo in ./opt/anaconda3/lib/python3.9/site-packages (4.1.1)

It looks like it is properly installed.It looks like you are using anaconda so you might have a virtual environment. Maybe try an conda activate command? You should see the virtual env name in ( ) to the left of your command prompt.

1 Like

Are you trying to prepare M220P mflix app, or you are trying to create a new app?

for mflix app, please check carefully each step of installing with anaconda form lecture notes, especially the activation of the virtual environment as @tapiocaPENGUIN stated above.

If you work on a new app, then it is possible you have a typo in naming if you copy-pasted the error into your post’s title: it is pymongo, not pymonog. and also the same virtual environment activation is required; you need to activate the one where you pip-installed pymongo.