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

Solution: Import the 'mpf' module

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

from mpmath import mpf

 

For more information:
Python mpmath mpf