Chapter 9 error with kaggle and dtreeviz

I’m trying to follow chapter 9.
I’m using SageMaker and following error: (after installing kaggle with !pip install kaggle

ModuleNotFoundError Traceback (most recent call last)
in ()
1 #hide
2 from fastbook import *
----> 3 from kaggle import api
4 from pandas.api.types import is_string_dtype, is_numeric_dtype, is_categorical_dtype
5 from fastai.tabular.all import *

ModuleNotFoundError: No module named ‘kaggle’
Thanks

Did you resolve this? I am having the same problem…scott

Yes. It is a matter of installing modules in the right environment

Hi there Joan,

Can you elaborate on your solution?

I managed to get this working by modifying the cloudformation template used to create the notebook instance. I updated the following lines:

In the OnCreate section from:

 pip install fastbook sagemaker

to

pip install fastbook sagemaker kaggle waterfallcharts treeinterpreter dtreeviz

And in the “OnStart” section from:

pip install fastai fastcore sagemaker --upgrade

to

pip install fastai fastcore sagemaker kaggle waterfallcharts treeinterpreter dtreeviz --upgrade

Hope that helps someone who runs into this in the future :slight_smile: