Fix Numpy f2py error ModuleNotFoundError No module named numpy.core._multiarray_umath

Numpy 1.15 made several changes on the way to Numpy 1.16. Some internal APIs of Numpy 1.15 were broken with regard to f2py, resulting in errors like:

ModuleNotFoundError: No module named ‘numpy.core._multiarray_umath’

when trying to import Fortran code compiled to Fortran modules with f2py.

Fix

The fix is to upgrade to Numpy ≥ 1.16, as there was major internal cleanup of Numpy ABI and API. Coincidentally, Numpy 1.16 was the last version to support Python 2.7. Either do:

conda install numpy

or

pip install --upgrade numpy