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

7 stars 5 forks source link

Mac M1 - Question how to make it work #18

Closed unickq closed 11 months ago

unickq commented 1 year ago
Version ⁨2.1.65 (aa9a734f)⁩
Python 3.9.15 Qt 6.5.0 PyQt 6.5.0
Batch Download Pictures From Google Images
8.29MB. Updated 2023-08-06.
'/Users/unickq/Library/Application Support/Anki2/addons21/561924305/vendor/PIL/_imaging.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

Before, there was an error saying PIP image didn't match the architecture. I installed it manually through pip install Pillow==9.4.0 and copied it to /Users/unickq/Library/Application Support/Anki2/addons21/561924305/vendor/PIL

Still see cannot import name '_imaging' from 'PIL', any ideas what can be done?

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue to the add-on author.
Debug info:
Anki 2.1.65 (aa9a734f) Python 3.9.15 Qt 6.5.0 PyQt 6.5.0
Platform: macOS-13.5-arm64-arm-64bit
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2023-08-16 11:36:19
Add-ons possibly involved: ⁨Batch Download Pictures From Google Images⁩

Caught exception:
Traceback (most recent call last):
  File "/Users/unickq/Library/Application Support/Anki2/addons21/561924305/__init__.py", line 401, in <lambda>
    a.triggered.connect(lambda _, b=browser: onAddImages(b))
  File "/Users/unickq/Library/Application Support/Anki2/addons21/561924305/__init__.py", line 394, in onAddImages
    updateNotes(browser, nids)
  File "/Users/unickq/Library/Application Support/Anki2/addons21/561924305/__init__.py", line 47, in updateNotes
    from PIL import Image, ImageSequence, UnidentifiedImageError
  File "/Users/unickq/Library/Application Support/Anki2/addons21/561924305/vendor/PIL/Image.py", line 103, in <module>
    from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/Users/unickq/Library/Application Support/Anki2/addons21/561924305/vendor/PIL/__init__.py)
kelciour commented 1 year ago

I'm not sure what went wrong, but maybe download Pillow-9.4.0-cp39-cp39-macosx_11_0_arm64.whl from https://pypi.org/project/Pillow/9.4.0/#files, unzip it somewhere and replace or copy everything from the PIL folder.

kelciour commented 11 months ago

The add-on was recently updated to use built-in mpv video player by default for image resizing, the PIL library is now optional (it's a bit faster) and no longer bundled with the add-on, but can be added manually into the 'vendors' folder.