fastbook
fastbook copied to clipboard
search_images_ddg(key,max_n=200)
As author of the function search_images_ddg (key,max_n=200)
, I have gotten several complaints of it not working. The function in the github repositoryutils.py/search_images_ddg
works as expected.
The problem is with the pip package version, fastbook-0.0.16.tar.gz
https://pypi.org/project/fastbook/#modal-close, where the file: __init__.py
overwrites and breaks the working version of search_images_ddg
Could the author of the pip package update it with working code from github, or else fix the the pip package version of the function and then update the github repository so there is only one version of the function?
Thanks
Hi prairie-guy,
What exactly wasn't working with search_images_ddg?
I was having an issue where urls = search_images_ddg('dogs', max_images=200)
would give
AttributeError: 'str' object has no attribute 'decode'
on the line 57 of fastbook/__init__.py
: res = urlread(url,data={'q':term}).decode()
.
I got around the issue by pasting the fixed function currently in utils.py into a code cell.
As you point out, the fastbook github code (which I originally submitted ) works. The problem is with the version of the function called by: pip install fastbook
That version of search_images_ddg
has been modified and doesn’t work. I’m not sure how to update the pip version.
I wrote the pull request for search_images_ddg
used in the fastbook
github repo. It works as expected. The pip repository of fastbook
has an error. There are several mentions of this problem in the Isssues
of this repo. Moreover, the fastai forum
has multiple mentions of it. Finally, as the Practical Deep Learning for Coders
course starts with a description of search_images_ddg
I would like this function to work correctly. I would update the pip repo myself, but I don’t know how. Can someone please fix the pip fastbook
repo?
I'd also note that the course uses search_images_ddg
with a max_images
flag whereas prairie-guy's code uses max_n
. If a new release is made using @prairie-guy's code, the course will also need to update its documentation to use the correct flag.