How to Solve NameError: name 'mpmath' is not defined

Solution: Import the 'mpmath' module

To Solve the error, add the following line to the top of your code.

import mpmath

 

For more information:
Python mpmath