MorphMan icon indicating copy to clipboard operation
MorphMan copied to clipboard

cannot import name 'gui_hooks'

Open GabbyNEW opened this issue 4 years ago • 2 comments

Debug info: Debug info: Anki 2.1.15 (442df9d6) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3 Platform: Windows 10 Flags: frz=True ao=True sv=1

Addons installed: AnkiConnect Frozen Fields Japanese Support MIA Dictionary MIA Japanese MIA Retirement

Caught exception: File "aqt\progress.py", line 72, in handler File "aqt\main.py", line 99, in setupProfileAfterWebviewsLoaded File "aqt\main.py", line 136, in setupProfile File "", line 2, in loadProfile File "anki\hooks.py", line 74, in decorator_wrapper File "anki\hooks.py", line 69, in repl File "aqt\main.py", line 276, in loadProfile File "anki\hooks.py", line 29, in runHook File "C:\Users\Gabby\AppData\Roaming\Anki2\addons21\900801631\morph\preferences.py", line 7, in init_preferences init_config_py() File "C:\Users\Gabby\AppData\Roaming\Anki2\addons21\900801631\morph\preferences.py", line 30, in init_config_py from . import config File "C:\Users\Gabby\AppData\Roaming\Anki2\addons21\900801631_init.py", line 87, in main() File "C:\Users\Gabby\AppData\Roaming\Anki2\addons21\900801631_init.py", line 81, in main from .morph.browser import browseMorph File "C:\Users\Gabby\AppData\Roaming\Anki2\addons21\900801631\morph\browser\browseMorph.py", line 6, in from ..newMorphHelper import focus, focusName File "C:\Users\Gabby\AppData\Roaming\Anki2\addons21\900801631\morph\newMorphHelper.py", line 14, in from . import main File "C:\Users\Gabby\AppData\Roaming\Anki2\addons21\900801631\morph\main.py", line 15, in from . import stats File "C:\Users\Gabby\AppData\Roaming\Anki2\addons21\900801631\morph\stats.py", line 7, in from aqt import toolbar, gui_hooks <class 'ImportError'>: cannot import name 'gui_hooks'

GabbyNEW avatar Jul 17 '20 13:07 GabbyNEW

I have a similar problem but it's this instead:

from . import stats
File "/Users/USER/Library/Application Support/Anki2/addons21/900801631/morph/stats.py", line 77, in <module> gui_hooks.top_toolbar_did_init_links.append(on_top_toolbar_did_init_links)
AttributeError: module 'aqt.gui_hooks' has no attribute 'top_toolbar_did_init_links'

So it seems like gui_hooks is actually imported?

Addons

AnkiConnect Japanese Support MeCab UniDic Japanese Dictionary MorphMan for Anki 21

saifahn avatar Jul 18 '20 07:07 saifahn

It looks like you'll need to update Anki to use the new version. I didn't realize it was incompatible with 2.1.15. I'll set the correct version on AnkiWeb.

landonepps avatar Jul 19 '20 21:07 landonepps