Kaggle kernel error - ModuleNotFound error importing 'fastai.structured'

Hello there,

I was using the fastai.structured module in the Blue book for Bulldozers kernel on Kaggle until yesterday.
All of a sudden today when i run the notebook, i am experiencing the following error:

No module named 'fastai.structured’

Any idea if anything has changed on Kaggle that i am unable to import the fastai.structured module in my kernel?

Any help would be very much appreciated.

Here’s my kernel: https://www.kaggle.com/kirannhegde/blue-book-for-bulldozers-using-random-forest

Regards,
Kiran Hegde

2 Likes

… same with me!

Hi,

I faced the same problem. I added the following code -
!pip install git+https://github.com/fastai/fastai@2e1ccb58121dc648751e2109fc0fbf6925aa8887

and

!apt update && apt install -y libsm6 libxext6

before these code.

from fastai.imports import *
from fastai.structured import *
from pandas_summary import DataFrameSummary
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from IPython.display import display
from sklearn import metrics

It is working :slightly_smiling_face:

10 Likes

Thank a lot! Man, you have saved my day! Although I hab to activate internet connection on the side bar of the notebook before I was able to install the packages:

3 Likes

Hi,
This works for fastai.structured
but not for
fastai.column_data
fastai.learner
fastai.rnn_reg
fastai.rnn_train *
fastai.nlp
fastai.lm_rnn
Do you have any solution for this ?
Thank you

I think it’s happening with everyone after the new update

2 Likes

Hi,
I am able to import fastai but when i am trying to run from fastai.imports import * , it throws an error as no module named fastai.imports found. It’s happening for fastai.structured & others as well.

I tried to run the two lines you provided but am getting an error for the second line ( !apt update && apt install -y libsm6 libxext6) as ‘apt’ is not recognized as an internal or external command, operable program or batch file.

Would really appreciate your help here.

Thanks

Using !pip install fastai==0.7.0 in a cell, solved it for me.

connect to internet and try running this

!pip install fastai==0.7.0

2 Likes

The !pip command worked for me to get rid of the uknown module for fastai.structure error and the code ran, but… when I tried committing the Kernel to submit the results, it still showed the same error.

Any ideas?

Hi,
I was getting the same error.
Now solved using !pip install fastai==0.7.0
thanks

I faced the same issue while using kaggle kernels and my error got solved with the below steps:

  1. Turn on internet inside Kaggle kernel.
  2. Adding these lines to the first cell of the kernel
    !pip install fastai==0.7.0
    !pip install torchtext==0.2.3

Hi, I tried both options suggested in the thread but I still get no module named fastai.structured in my Kaggle kernel.

Does anyone kindly know another workaround?

Thanks a lot man. worked for me too :grinning:

I think you may find useful this guide this post here by Jeremy