From a9e6a53360123be3b7444595e60e46d51cd4d684 Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Sat, 17 Dec 2016 15:38:48 -0800 Subject: [PATCH] Print helpful error message when libgcc error occurs. (#133) --- numbuf/numbuf/__init__.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/numbuf/numbuf/__init__.py b/numbuf/numbuf/__init__.py index 42ad48c78..ecab03681 100644 --- a/numbuf/numbuf/__init__.py +++ b/numbuf/numbuf/__init__.py @@ -2,4 +2,18 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -from numbuf.libnumbuf import * +# See https://github.com/ray-project/ray/issues/131. +helpful_message = """ + +If you are using Anaconda, try fixing this problem by running: + + conda install libgcc +""" + +try: + from numbuf.libnumbuf import * +except ImportError as e: + if not hasattr(e, "msg") or not isinstance(e.msg, str) or not "GLIBCXX" in e.msg: + raise + e.msg += helpful_message + raise