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

(KNH) #1

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

Kiran Hegde


… same with me!

(Bhuvana Kundumani) #3


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


!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:

Fastai 1.0.6 not working in kaggle
Fast AI V1 on Kaggle Kernels now, but `torch` not compatible
Part 1 lessons as Kaggle Kernels

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:

(amr) #5

This works for fastai.structured
but not for
fastai.rnn_train *
Do you have any solution for this ?
Thank you

(Mayank) #6

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

(Deepak) #7

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.


(odysseus.kaziolas) #8

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

(abhi) #9

connect to internet and try running this

!pip install fastai==0.7.0

(Kseniya Stepanova) #10

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?