How to install scikit-automl in a Kaggle notebook

How to install scikit-automl in a Kaggle notebook

I wanted to give scikit-automl a try, but I don’t like to install many packages on my machine. Conda solves the problem of creating a mess, although it does not deal with the issue of running unknown code on my computer. Hence, I decided to try it on Kaggle.

I followed the installation instructions and did not expect any issues. After all, the instruction consists of only two steps:

!curl | xargs -n 1 -L 1 pip install
!pip install auto-sklearn

Do you want to show your product/service to 25000 data science enthusiasts every month? I am looking for companies which would like to become a partner of this blog.

Are you interested? Is your employer interested? Here are the details of the offer.

What can go wrong?

Swig. Swig can go wrong. I was installing the packages, and at some point, I saw this error message. Pip was installing the pyrfr package but failed because of a problem with swig.

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

It turns out that Kaggle has some old swig version installed on their machines, but we can quickly fix it:

!apt-get remove swig
!apt-get install swig3.0
!ln -s /usr/bin/swig3.0 /usr/bin/swig

After that change, I ran the installation script, and everything worked fine.

Remember to share on social media!
If you like this text, please share it on Facebook/Twitter/LinkedIn/Reddit or other social media.

If you watch programming live streams, check out my YouTube channel.
You can also follow me on Twitter: @mikulskibartosz

If you want to hire me, send me a message on LinkedIn or Twitter.

If this article was helpful, consider donating to WWF or any other charity of your choice.
Bartosz Mikulski
Bartosz Mikulski * data scientist / software engineer * conference speaker * organizer of School of A.I. meetups in Poznań * co-founder of Software Craftsmanship Poznan & Poznan Scala User Group