ModuleNotFoundError: No module named 'mflix'

I am geting the following error out put on pytest for the Connection ticket. Can anyone help me to resolve this?

PS D:\mflix-python> pytest -m connection
ImportError while loading conftest ‘D:\mflix-python\tests\’.
tests\ in
from mflix.factory import create_app
E ModuleNotFoundError: No module named ‘mflix’

you have to enable your virtuzl env.

no i tried it it was gving propblem so its a clean ptyhon 3.8.5 with all latest versions of libraries installed. now there is a bit of progress, pytest -m connection is passing with 43 documents but tests for test_db_connections are not passing and app is able to connect to collection in mongodb atlas. So, i have not any “Validation Code”

Some more progress after virtual env is enabled. its failing second test with 23530 items collected vs 23531 expected.

Hi @Ashish_80469,

Did you recently load the sample data into your mflix cluster ?

We have recently updated the dataset and now the total count of documents in the sample_mflix collection is 23530.

~ Shubham

yes, the code i believe is verifying for 23531 still ! Anyway, I adjusted it adding a duplicating one document to match the number 23531, and save the duplicated document in case it creates error later. Thank you so much for reply, I have completed the course as well, indeed it was great experience and loved figuring out this problem, I completed the course on a local instance of MongoDB.

Hi @Ashish_80469,

That looks nice but for further tickets, I would still recommend downloading the latest handout zip from the course which has tests for 23530 documents.


Sure, Will do that.