kelciour / batch-download-pictures-from-google-images

7 stars 5 forks source link

Can't make sense of this - installation error... #27

Closed danMulligan closed 5 months ago

danMulligan commented 5 months ago

Hi there,

I've tried asking GPT (my guide to explaining system errors like i'm a four year old)... but I can't get another further with this error:

Here's a breakdown of the error message:

The add-on attempts to import the PIL module in its code. Within the PIL module, there's an attempt to import the _imaging module, which is a part of PIL's internal implementation. However, when trying to load the _imaging module, there's an ImportError because it cannot find the required library libXdmcp.6.dylib. This error suggests that the PIL module is missing a necessary library (libXdmcp.6.dylib), which is needed for its functionality. The add-on appears to be referencing this library within its vendor directory, but there's an issue with loading it.

I thought perhaps it wasn't running because my macbook runs Python 2.7 so I downloaded 3.9.2rc1 (I'm running OSX 10.13) But I'm up against more my own ignorance again... once I have 3.9 installed, don't I need to "configure your system to use Python 3.9.2 as the default version" ...?

My Anki version is Version ⁨2.1.62 (77dd1dc1)⁩ Python 3.9.15 Qt 5.14.2 PyQt 5.14.1 (which is why I thought maybe the Add-on isn't working because it needs newer Python...)

Please advise, I'd love to get your Add-on working, and would definitely donate coffee funds for the assistance!

regards Dan

danMulligan commented 5 months ago

I've managed to get the Add-On working on my iMac... it's also 10.13 but loaded with out issue. Any advice for side stepping blank results. I read somewhere it's because of _ underscores being used to name the images (which Anki then discards).

kelciour commented 5 months ago

If you update Anki to the latest version (23.10-23.12.1+) and update the add-on, the PIL library won't be required anymore and the add-on should work without it. I guess, this is what you did.


If you installed Anki using the official installer from https://apps.ankiweb.net/, the Python executable will be bundled with Anki and the system Python executable will be ignored (Help > About).

The system Python executable will only be used if you run Anki from source - https://github.com/ankitects/anki/blob/main/docs/development.md#building-from-source - or use pre-built Python wheels - https://github.com/ankitects/anki/blob/main/docs/development.md#pre-built-python-wheels


The issue with _ in the filenames was fixed in the version for Anki 23.10-23.12.1+, but they should display just fine anyway and it only affects Tools > Check Media, Anki won't mark them as unused and they will take some extra space in the collection.media folder if notes were removed,

About blank results, if some images were added to some cards and some cards don't have any new images, maybe Google Images returns no results for the same search query. It can be checked by running this gist using debug console - https://docs.ankiweb.net/misc.html#debug-console - and replacing "cat" with your query - https://gist.github.com/kelciour/86bfa1bbcc256fbaa780ab725da14714

kelciour commented 5 months ago

Since it seems to be working, I'll close the issue. Feel free to reopen or create a new issue for blank results with some additional information or some steps to reproduce it.