This can happen by Corrupted files in venv or the packages not installed in venv
To fix this: Try recreating venv and activate venv on the terminal. Then install the packages