Not sure why that doesn't work, but you could try importing it from mpmath.libmp.