diff --git a/pandas/__init__.py b/pandas/__init__.py index 8d9b75ccd6c2c..5fc347f4a5aea 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -28,7 +28,11 @@ tslib as _tslib) except ImportError as e: # pragma: no cover # hack but overkill to use re - module = str(e).replace('cannot import name ', '') + module = str(e).replace('cannot import name ', '')\ + .replace('No module named ', '') + if 'does not export' in module: + # GH#18089 + raise raise ImportError("C extension: {0} not built. If you want to import " "pandas from the source directory, you may need to run " "'python setup.py build_ext --inplace --force' to build "