Beginner: Using Colab or Kaggle ✅

It’s because the library used to find images using duckduckgo is outdated. Here’s an updated version of the method that you can use which will allow you to search for images:

from duckduckgo_search import DDGS
from fastcore.all import *

def searchImages(searchTerm, maxImages=30):
  print(f"Searching for '{searchTerm}'")
  results = L(DDGS().images(
    keywords=searchTerm,
    max_results=maxImages
    )).itemgot('image')

  return results

Note, I changed the name of the method and parameter because underscores are :nauseated_face: but this will allow you to get past the above error you’re getting.

1 Like