Skip to content

Instantly share code, notes, and snippets.

@vlavorini
Created October 14, 2018 08:16
Show Gist options
  • Save vlavorini/55885481aa2c5a1a81950d1dd9921cad to your computer and use it in GitHub Desktop.
Save vlavorini/55885481aa2c5a1a81950d1dd9921cad to your computer and use it in GitHub Desktop.

Solving PyRFR issue (SMAC or auto-sklearn)

TL:DR

  • If you already have a version of GCC > 7.2, you can skip this step. Otherwise you have to install it: brew install gcc ;
  • make sure the symbolic links are created, i.e. /usr/local/bin/gcc -> gcc-7, /usr/local/bin/g++ -> g++-7
    • I used the version 7 of GCC, but probably a newer version will work too.
  • tell PIP to compile the package, avoiding the pre-compiled binaries: pip install --force-reinstall --ignore-installed --no-binary :all: pyrfr

The source of the issue

It seems that a lot of users (like me) have issues on installing the Random Forest Run package from AutoML on a Mac.

Notably, often peolple are faced with:

ImportError: No module named '_regression'

This happens because the PyRFR binaries which comes with PIP are compiled with the version 7.2 of GCC, and then there is some symbol that the sytem is unable to understand. Notably:

undefined symbol: _ZTVNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEE

The built-in GCC compiler for the macOS (at least, for High Sierra) is the 4.x That's why we need to install a newer GCC version.

Now that we have the compiler installed, we have to tell PIP to use this compiler to create the binaries, that's what the --no-binaries flag of PIP stands for.

That's all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment