Error: No module named 'mariadb'


I am developing an application using Frappe framework. Here, I am trying to create connection with mariadb, but getting following error:

ImportError: Module import failed for VAT Return Form (accuvat.return_processing.doctype.vat_return_form.vat_return_form Error: No module named ‘mariadb’)

However, it is working in a raw .py file, but not in a DocType.