I have solved this problem by downgrading to the python library, removing it using virtualenv pip uninstall MarkupSafe and then installing version 2.0.1 pip install markupsafe==2.0.1
This is because in version 2.1.0 , they removed the soft_unicode.
For more information : MarkupSafe Issue