L8: AttributeError: module 'utils' has no attribute 'get_products_and_category'

I reproduced this notebook into a Google Colab.
Found the products.json and utils.py files and uploaded them into my Google Colab.

I tested this a couple of weeks ago in Google Colab and it worked!
I’m now rerunning this but I get the following error when I try to retrieve the list of products and categories that are in the product catalog:

AttributeError: module ‘utils’ has no attribute ‘get_products_and_category’

Consequently the following cells don’t work either anymore.

So I would guess the products.json and utils.py files can be found but I don’t get the error. My first guess is a function is missing in the utils.py file but I walked through it and it is the exact same file from the course.
And it doesn’t explain why it worked a couple of weeks ago.

Notebook still working fine in the course’s jupyter. So I’d say nothing has changed.

Seems like the viable theories would be: a) something changed in the arrangement of the files on your Google Drive or b) you’re not actually in the same “current working directory” in the active notebook on Colab.

Might be worth having a look through Saif’s excellent tutorial on how to get course notebooks to work in the Colab context. Note that the material there is specific to the DLS course notebooks and I have not looked at any of the newer “short course” assignments, so not sure whether there are any significant differences in the notebook you’re actually working with.

Thx for the reply.

I’m not using my Google Drive, I upload the files directly into the Colab Runtime Storage.
This did the trick a couple of weeks ago but not now anymore it seems…

Sorry, I don’t have that much experience with Colab. I thought that the only way to get it to use files of your own was to access them through your Google Drive. That is an alternative and you might try that. Did you read through that thread from Saif? It explains at least the Google Drive way of doing things.

Yes, I did read it, very interesting indeed.

Nevermind, I’ll try something else (you can also put the content of such a .py-file directly into a cell in the notebook and run it from there.

Hi Beejay. I’m curious, did you manage to make progress on this issue?

Hi dvvilkins,

Sorry for the late reply,
Yes: putting the content of the said .py-files directly into the cells in Colab works.
Bit cumbersome but anyway…