简体   繁体   中英

Installing AutoSKLearn in Anaconda Environment

I am trying to install autosklearn in anaconda environment AutoSKLearn , after that i am using jupyter notebook and trying to import autosklearn.classification but i got this error, "ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject". How i can fix this error ?

Everyghing is explained here .

Anaconda installation
Anaconda does not ship auto-sklearn, and there are no conda packages for auto-sklearn. Thus, it is easiest to install auto-sklearn as detailed in the Section Installing auto-sklearn.

A common installation problem under recent Linux distribution is the incompatibility of the compiler version used to compile the Python binary shipped by AnaConda and the compiler installed by the distribution. This can be solved by installing the gcc compiler shipped with AnaConda (as well as swig):

conda install gxx_linux-64 gcc_linux-64 swig

As per autosklearn documentation, it won't officially supports on windows,

auto-sklearn relies heavily on the Python module resource. resource is part of Python’s Unix Specific Services and not available on a Windows machine. Therefore, it is not possible to run auto-sklearn on a Windows machine.

Possible solutions (not tested):

Windows 10 bash shell

virtual machine

docker image

**** How to install auto-sklearn and pyrtr on Mac OS Big Sur 11.2.1 and gcc 10.2.04 ****

This is how I successfully installed auto-sklearn on Mac OS Big Sur, under Anaconda 3

The bottleneck was to use the latest gcc compiler to install pyrfr, which is a dependency for auto-sklearn, and a couple of other things. On Mac OS, C++ and dev tools are installed with xcode-select, and the default version of C++ compiler is not the one we need (refer to this thread ):

gcc --version

The default is being /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

First, make sure everything is updated:

xcode-select --install

brew update brew upgrade brew info gcc brew install gcc brew cleanup brew doctor

And update conda too, just in case:

conda update -n base conda conda update --all

("conda install gcc" wouldn't work for me, like some threads suggested, and "conda config --set restore_free_channel true" did not help either) if "frozen"

conda update -prefix /opt/anaconda3 anaconda

But "brew install gcc" installed gcc for me, and now all we need to make an alias in ~/.zshrc (or ~/.bash_profile or ~/.bashrc, if you have not switch to use zsh, which is the default in newer Mas OS)

brew gcc info gcc: stable 10.2.0 (bottled), HEAD GNU compiler collection https://gcc.gnu.org/ /usr/local/Cellar/gcc/10.2.0_4

Suggested, my gcc now is in /usr/local/Cellar/gcc/10.2.0_4/bin/gcc-10 Check: /usr/local/Cellar/gcc/10.2.0_4/bin/gcc-10 -v

Making an alias:

vi ~/.zshrc add alias alias gcc="/usr/local/Cellar/gcc/10.2.0_4/bin/gcc-10" source ~/.zshrc

Now, proceed with installations:

brew install swig pip install lazy-import pip install pyrfr --no-cache-dir pip install auto-sklearn --no-cache-dir

Done!

Maybe, this helps:

pip uninstall pyrfr auto-sklearn curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip install CC=/usr/local/Cellar/gcc/10.2.0_4/bin/gcc-10 pip install lazy-import pyrfr auto-sklearn --no-cache-dir

Or, if you managed to install gcc in Anaconda3:

pip uninstall pyrfr auto-sklearn curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip install CC=/Users//opt/anaconda3/bin/gccpip install pyrfr auto-sklearn --no-cache-dir

Maybe, you need to re-install auto-sklearn, then

pip install autosklearn --no-cache-dir --force-reinstall -I --no-deps --upgrade

Additional resources, that might help to get there: https://medium.com/@dvdasari/install-latest-gcc-on-mac-os-x-b4ce9a66a184 http://www-scf.usc.edu/~csci104/installation/gccmac.html https://github.com/automl/auto-sklearn/issues/155

Try: conda install -c conda-forge auto-sklearn

https://anaconda.org/conda-forge/auto-sklearn

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM