From 0aa234fb9c613ee592f54db6c3ec75436aeaa9d0 Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Thu, 9 Feb 2017 23:29:43 -0800 Subject: [PATCH] Fix CXX numbuf error message for Anaconda 3.6. (#258) --- doc/install-on-macosx.md | 6 ++++++ doc/install-on-ubuntu.md | 6 ++++++ python/numbuf/__init__.py | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/install-on-macosx.md b/doc/install-on-macosx.md index 3e9b5234f..83e0b6ead 100644 --- a/doc/install-on-macosx.md +++ b/doc/install-on-macosx.md @@ -14,6 +14,12 @@ brew install cmake automake autoconf libtool boost wget pip install numpy cloudpickle funcsigs colorama psutil redis --ignore-installed six ``` +If you are using Anaconda, you may also need to run the following. + +``` +conda install libgcc +``` + # Install Ray Ray can be built from the repository as follows. diff --git a/doc/install-on-ubuntu.md b/doc/install-on-ubuntu.md index 130dc3d68..7c971d514 100644 --- a/doc/install-on-ubuntu.md +++ b/doc/install-on-ubuntu.md @@ -15,6 +15,12 @@ sudo apt-get install -y cmake build-essential autoconf curl libtool libboost-all pip install numpy cloudpickle funcsigs colorama psutil redis ``` +If you are using Anaconda, you may also need to run the following. + +``` +conda install libgcc +``` + # Install Ray Ray can be built from the repository as follows. diff --git a/python/numbuf/__init__.py b/python/numbuf/__init__.py index a4d0a82ea..bc541516a 100644 --- a/python/numbuf/__init__.py +++ b/python/numbuf/__init__.py @@ -13,10 +13,10 @@ If you are using Anaconda, try fixing this problem by running: try: from core.src.numbuf.libnumbuf import * except ImportError as e: - if hasattr(e, "msg") and isinstance(e.msg, str) and "GLIBCXX" in e.msg: + if hasattr(e, "msg") and isinstance(e.msg, str) and ("libstdc++" in e.msg or "CXX" in e.msg): # This code path should be taken with Python 3. e.msg += helpful_message - elif hasattr(e, "message") and isinstance(e.message, str) and "GLIBCXX" in e.message: + elif hasattr(e, "message") and isinstance(e.message, str) and ("libstdc++" in e.message or "CXX" in e.message): # This code path should be taken with Python 2. if hasattr(e, "args") and isinstance(e.args, tuple) and len(e.args) == 1 and isinstance(e.args[0], str): e.args = (e.args[0] + helpful_message,)