Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto-sklearn installation error

I'm trying to install auto-sklearn using pip install auto-sklearn, but it raises the error:

Command "/usr/bin/python3.5 -u -c "
    import setuptools, tokenize;
    __file__='/tmp/pip-build-tl8y2tfg/psutil/setup.py';
    f=getattr(tokenize, 'open', open)(__file__);
    code=f.read().replace('\r\n', '\n');
    f.close();
    exec(compile(code, __file__, 'exec'))
"install 
    --record /tmp/pip-7t8rbku0-record/install-record.txt 
    --single-version-externally-managed --compile" 
failed with error code 1 in /tmp/pip-build-tl8y2tfg/psutil/

There is nothing starting with "pip-" in my /tmp/ directory.

I made all steps exactly as in manual, but still have this error.

I also tried to use commands from this question, but got the same error in both cases.

My OS is Ubuntu 16.04.2.

How can I install auto-sklearn?

like image 234
evaleria Avatar asked Jun 20 '17 18:06

evaleria


People also ask

What is auto-Sklearn?

Auto-Sklearn is an open-source library for performing AutoML in Python. It makes use of the popular Scikit-Learn machine learning library for data transforms and machine learning algorithms and uses a Bayesian Optimization search procedure to efficiently discover a top-performing model pipeline for a given dataset.


2 Answers

auto-sklearn installation requires python 3.5 or higher. In addition, it also has dependencies on the packages mentioned here: https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt

As per the error, you seem to have an issue at psutil installation.

A better approach is to have a python 3.5+ environment. And then using pip install auto-sklearn.

  • Check which version/path are you using - which python, which pip
  • Install python 3.5 or higher, if you don't have it already: steps to follow
  • Once you have the correct version of python installed, set up a virtual environment of the python3.5. Follow the code to setup a virtual environment:

python3 -m pip install --user virtualenv

source env/bin/activate

  • Finally call pip install auto-sklearn

Update:

  • In case you are using anaconda, following command will start your virtual env:

    conda update conda #Update your current version of conda

    conda create --name py35 python=3.5 #creat e a virtual env for python 3.5

    source activate py35 #activate the environment

Post your query here, again in case you are not sure of the steps.

like image 82
Ankita Mehta Avatar answered Oct 21 '22 02:10

Ankita Mehta


For anyone coming to this question, I encountered this issue trying to install on OSX. The author may have left off some of her stack trace. Namely:

    Installing collected packages: pyrfr
  Running setup.py install for pyrfr ... error
    Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/g5/vdl1tlwd333d5vzfw4qfc86c0000gp/T/pip-install-zy5yrmfh/pyrfr/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/g5/vdl1tlwd333d5vzfw4qfc86c0000gp/T/pip-record-iuj3muyd/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    running install
    running build_ext
    building 'pyrfr._regression' extension
    swigging pyrfr/regression.i to pyrfr/regression_wrap.cpp
    swig -python -c++ -modern -features nondynamic -I./include -o pyrfr/regression_wrap.cpp pyrfr/regression.i
    unable to execute 'swig': No such file or directory
    error: command 'swig' failed with exit status 1

Your installation errors are likely caused by not having swig installed.

Swig is a C / C ++ code generator, an interface for python to use C libraries.

You can install it by following the instructions at their project website here: http://www.swig.org/Doc4.0/SWIGDocumentation.pdf

Basically, download the most recent tarball archive from the website. Extract it. cd to the extracted folder and run:

./configure
make
make install
curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip3 install

And you should be good to run auto-sklearn.

like image 45
Wolf Rendall Avatar answered Oct 21 '22 02:10

Wolf Rendall