Hi
Since release fastai2 (few days ago) , name pip package “fastai” becomes fastai in version 2
and your code applies to version 1
You may install fastai version 1 directly from repo https://github.com/fastai/fastai1 if you have to.
pip install https://github.com/fastai/fastai1/archive/master.zip
But it is preferable to switch to version 2 (but you will have to migrate your network)