Stvad / CrowdAnki

Plugin for Anki SRS designed to facilitate cooperation on creation of notes and decks.
MIT License
520 stars 44 forks source link

Crashes with Python 3.10 #156

Closed AlexBocken closed 2 years ago

AlexBocken commented 2 years ago

After updating to python 3.10 on my system it seems like CrowdAnki crashes on startup.

Here's the oupout by Anki:

An add-on you installed failed to load. If problems persist, please go to the Tools>Add-ons menu, and disable or delete the add-on.

When loading '⁨CrowdAnki JSON exportimport Edit history Collaborate on deck creation⁩':
⁨Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/aqt/addons.py", line 230, in loadAddons
    __import__(addon.dir_name)
  File "/home/alex/.local/share/Anki2/addons21/1788670778/__init__.py", line 5, in <module>
    from . import main
  File "/home/alex/.local/share/Anki2/addons21/1788670778/main.py", line 8, in <module>
    from .anki.hook_vendor import HookVendor
  File "/home/alex/.local/share/Anki2/addons21/1788670778/anki/hook_vendor.py", line 6, in <module>
    from ..export.anki_exporter_wrapper import exporters_hook
  File "/home/alex/.local/share/Anki2/addons21/1788670778/export/anki_exporter_wrapper.py", line 3, in <module>
    from .anki_exporter import AnkiJsonExporter
  File "/home/alex/.local/share/Anki2/addons21/1788670778/export/anki_exporter.py", line 11, in <module>
    from ..representation import deck_initializer
  File "/home/alex/.local/share/Anki2/addons21/1788670778/representation/deck_initializer.py", line 1, in <module>
    from functional import seq
  File "/home/alex/.local/share/Anki2/addons21/1788670778/dist/functional/__init__.py", line 7, in <module>
    from functional.streams import seq, pseq
  File "/home/alex/.local/share/Anki2/addons21/1788670778/dist/functional/streams.py", line 12, in <module>
    from functional.pipeline import Sequence
  File "/home/alex/.local/share/Anki2/addons21/1788670778/dist/functional/pipeline.py", line 17, in <module>
    from tabulate import tabulate
  File "/home/alex/.local/share/Anki2/addons21/1788670778/dist/tabulate.py", line 16, in <module>
    from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/usr/lib/python3.10/collections/__init__.py)

Looking at the AnkiWeb site for this Addon it seems like someone already had this issue on December 10th. At least it crashes for someone.

My guess is still that this might be because of python 3.10 as I didn't have any issues this morning before upgrading from 3.9 to 3.10. I'm running Arch Linux (btw), Python 3.10. Let me know if you need any other information to get this issue resolved.

aplaice commented 2 years ago

Thanks for the report!

The crash is due to the old version of tabulate in dist/ in the current released CrowdAnki version. You'll almost certainly have version 0.8.7. (You can check by looking for something like: /home/alex/.local/share/Anki2/addons21/1788670778/dist/tabulate-0.8.7-py3.7.egg-info/.)

In master we've updated to tabulate 0.8.9 (which deals correctly with Python 3.10), but this hasn't been released yet. (It should be soon.)

In the meantime, you could manually patch your installation by copying the latest tabulate.py to replace the old one (/home/alex/.local/share/Anki2/addons21/1788670778/dist/tabulate.py).


Arch Linux (btw)

:)

AlexBocken commented 2 years ago

Awesome, thanks for the detailed write-up. Manually updating tabulate.py fixed it as you said.

On 21/12/13 07:52AM, aplaice wrote:

Thanks for the report!

The crash is due to the old version of tabulate. I guess that you'll have version 0.8.7. (You can check by looking for something like: /home/alex/.local/share/Anki2/addons21/1788670778/dist/tabulate-0.8.7-py3.7.egg-info/.)

In master we've updated to tabulate 0.8.9, but this hasn't been released yet.

In the meantime, you could manually patch your installation by copying the latest tabulate.py to replace the old one (/home/alex/.local/share/Anki2/addons21/1788670778/dist/tabulate.py).


Arch Linux (btw)

:)

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/Stvad/CrowdAnki/issues/156#issuecomment-992614646