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:

1
2
!curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip install
!pip install auto-sklearn

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.

1
2
3
4
5
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:

1
2
3
!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.

Did you enjoy reading this article?
Would you like to learn more about leveraging AI to drive growth and innovation, software craft in data engineering, and MLOps?

Subscribe to the newsletter or add this blog to your RSS reader (does anyone still use them?) to get a notification when I publish a new essay!

Newsletter

Do you enjoy reading my articles?
Subscribe to the newsletter if you don't want to miss the new content, business offers, and free training materials.

Bartosz Mikulski

Bartosz Mikulski

  • MLOps engineer by day
  • AI and data engineering consultant by night
  • Python and data engineering trainer
  • Conference speaker
  • Contributed a chapter to the book "97 Things Every Data Engineer Should Know"
  • Twitter: @mikulskibartosz
  • Mastodon: @mikulskibartosz@mathstodon.xyz
Newsletter

Do you enjoy reading my articles?
Subscribe to the newsletter if you don't want to miss the new content, business offers, and free training materials.