Question: Why module 'openimages' has no attribute 'download'?

this topic is just a question about something I want to understand, because I don’t know the reason for it.

So, I installed openimages with pip. When I try to use openimages like that:

import openimages"example",['castle'])

I’m getting these error message:

AttributeError: module 'openimages' has no attribute 'download'

But when I change the lines to:

from import download_dataset
download_dataset(dest_dir="example", ['castle'])

then it works.

So can just someone explain, why?
Thanks :slight_smile:

Hello defa,

It has to do with how Python deals with package imports. Have a look at this link.

In brief, I think it’s because the file inside the openimages package does not include a command to import the download module.

Hope this helps!