ModuleNotFoundError: No module named 'public_tests'


Any one can help me with

ModuleNotFoundError: No module named ‘public_tests’ ?

Thank you,

Hi @rakhshanpous,

Where are you running this assignment ?

Within the Coursera platform or elsewhere ?


Hey @rakhshanpous,
Welcome, and we are glad that you could become a part of our community :partying_face: As Mubsi pointed out, the Coursera labs and assignments are designed with the intention of running on Coursera Labs (and their current environments). If you run the assignments on your local machine, you are highly likely to get errors regarding the package versions. That being said public_tests is not a Python package but a custom module, which you can easily download by downloading all the files associated with an assignment. For instructions on how to do so, please check out this thread. Let us know if this resolves your error.


Thank you @Elemento and @Mubsi for your reply. I am working at Spyder. The Coursera Platform is ok. I walked through the link that @Elemento shared and I my error fixed. Thank you so much