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 but this will allow you to get past the above error you’re getting.