To solve ImportError: No module named mock error follow below methods.
ImportError: No module named mock
How to solve ImportError: No module named mock ?
Refer the given methods to solve the issue.
unittest is a built-in module;
mock is an external library . After installing
pip install mock, you import it not by using
from unittest.mock import MagicMock
from mock import MagicMock
mock has been included in the
unittest module, and can be imported by
Hope the above solution works.
Also read :