Tag Archives: python.exe: Error while finding module specification for ‘testcase_1.Test’…..

Prompt python.exe when using the command line to run the use case: error while finding module specification for ‘testcase_1.Test’…..

File path

Enter the command D:\demo > python -m unittest unittest_1/testcase_1.Test result prompt   ModuleNotFoundError: No module named ‘unittest_1/testcase_1’, see the figure for details

Solution: enter unittest_1 path, and then enter the command Python – M unittest testcase_1.Test

Enter command python -m testcase_1.Test result prompt error while finding module specification for ‘testcase_1.Test’ (ModuleNotFoundError: __path__ attribute not found on ‘testcase_1’ while trying to find ‘testcase_1.Test’)

Solution: the command statement is incorrect. The command to be executed is Python – M unittest module name.Class name