"import fastbook" failing - module fastai.callback.all not found

Is anyone else getting the following error?

“ModuleNotFoundError: No module named ‘fastai.callback.all’; ‘fastai.callback’ is not a package”

Either you need to update your fastai version (you need to do that in Colab each time, as of now, as far as I know)
if you’ve done that and still have that problem, type “import fastai.callback.all” as well, and you should be good to go…

Yes “import fastai.callback.all” worked. Thank you for your response!

However, it seems like this is a regression from earlier. It worked fine earlier.

To answer this further - the issue is Google Colab has the older version of fastai installed. To see this:

import fastai
print(fastai.__version__)

I had version 1.0.61.

To upgrade:

!pip install fastai --upgrade --use-feature=2020-resolver

After Oct 2020, there was an alert to add the flag --use-feature=2020-resolver

`

3 Likes

Hello,
I still get the same error even after including “import fastai.callback.all”.

I am also getting the same error while trying to import from fastai. callbacks import *.
Kindly, help if someone knows how to debug this.

1 Like

Hello,

It is weird, till yesterday my colab notebooks were working well, but today I am getting the same error as @fastuser. I added the line of code as import fastai.callback.all , but it did not help. I will appreciate it if you can help me to solve the problem.

Interesting, because I have exactly the same problem (see figure below):

I know for sure (!!!) that last week it was working perfectly fine! Sth. must have changed.

I have the feeling that Google Colab is not reliable sometimes :frowning:

3 Likes

I just run the notebooks on Paperspace Gradient and got the same error, I think they’ve changed something which is not working.

2 Likes

Yeah, me too. Everything is fine until today afternoon. But when I run again at evening , that error is appeared too. I have no idea why is this happening.(I am a new comer)

It looks like the fastbook github page had a commit that went through a few hours ago that was messing around with the search_images_bing function and must have an error, I’m having the exact same issue as @RamboFast -

1 Like

I have the same problem.
It just happened.
any solution,

please.

As a temporary fix, assuming that you don’t need to use the search_images_bing function, you can go into the file directory on Colab to /usr/local/lib/pythn3.6/dist-packages/fastbook/ and edit the init.py script, and just delete that specific function, then run the import and setup lines of code without the !pip install and that seems to be working

Do you think I should write an official GitHub Issue to this problem? I think this is the proper way to approach such problems. At the moment, this problem was not issued (as you can see here)

Are you still facing the issue? I checked it, and didnt encounter the error…

Can you please include some screenshots? I tried running the setup code on my Colab, and didnt encounter this problem

No, It fixed. thanks

How did you fix it? I’m experiencing this issue currently. This must have something to do with one or more of the modules being imported before fastai.

1 Like

Nothing, Just do factory reset runtime and then " pip install fastbook --upgrade" to upgrade the module. it should be fixed

2 Likes

Thank you. It worked in a clean colab book, but for some reason, not in another one that had a good number of imports in it.

2 Likes