'Running into PermissionError: [Errno 13] Permission denied while collecting image data

I am working through the fastai deep learning course and one of the tasks involves downloading images through google images.

However, when I try to download the images, I keep running into the following error:

PermissionError: [Errno 13] Permission denied

This is the code I am working with:

from fastbook import *

folder = 'black'
file = 'grizzly bears.txt'

path = Path('bears')
dest = (path/folder)
dest.mkdir(parents=True, exist_ok=True)

download_images(path/file, dest, max_pics=20)

Providing the image for additional context

Some of the functions that I am using here are part of the fastai module.

Would greatly appreciate any input on how to fix this issue.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source