From 7c478d78f1d0aa87dd1ae935c641764da8c836eb Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Fri, 3 Nov 2017 13:08:30 -0700 Subject: [PATCH] fix error messages closes #18089 --- pandas/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 "