From eca0a14765faa78805d4c3e883599acaafd1a0e2 Mon Sep 17 00:00:00 2001 From: David Read Date: Tue, 16 May 2017 10:40:42 +0100 Subject: [PATCH] Fixes truncated error message "C extension: umpy.core.multiarray failed to import" This occurred because lstrip is the wrong tool here: >>> e = 'cannot import name numpy.core.multiarray' >>> str(e).lstrip('cannot import name ') 'umpy.core.multiarray' Better: >>> str(e).replace('cannot import name ', '') 'numpy.core.multiarray' --- pandas/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/__init__.py b/pandas/__init__.py index 48ac9d173559d..8d9b75ccd6c2c 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -28,7 +28,7 @@ tslib as _tslib) except ImportError as e: # pragma: no cover # hack but overkill to use re - module = str(e).lstrip('cannot import name ') + module = str(e).replace('cannot import name ', '') 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 "