# ImportError when opening anki

**URL:** <https://forums.ankiweb.net/t/importerror-when-opening-anki/22567>\
**Category:** Help\
**Created:** [August 24, 2022, 8:48am UTC](https://forums.ankiweb.net/t/importerror-when-opening-anki/22567 "2022-08-24T08:48:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![YaoReTian](https://avatars.discourse-cdn.com/v4/letter/y/e19b73/32.png) [@YaoReTian](https://forums.ankiweb.net/u/YaoReTian)\
**Post date:** [August 24, 2022, 8:48am UTC](https://forums.ankiweb.net/t/importerror-when-opening-anki/22567/1 "2022-08-24T08:48:41Z")

</div>

I run Arch linux and am using Anki 2.1.54, and decided to install Ki command line tool for converting Anki collections into git repos.

After doing a full system update, installing Ki and restarting my computer, anki has stopped working and replied with the following error:

`File "/usr/bin/anki", line 17, in <module> import aqt File "/usr/lib/python3.10/site-packages/aqt/ __init__.py", line 74, in <module> from aqt.main import AnkiQt # isort:skip File "/usr/lib/python3.10/site-packages/aqt/main.py", line 21, in <module> import aqt.mediasrv File "/usr/lib/python3.10/site-packages/aqt/mediasrv.py", line 25, in <module> import aqt.operations File "/usr/lib/python3.10/site-packages/aqt/operations/ __init__.py", line 12, in <module> from anki.collection import ( ImportError: cannot import name 'ImportLogWithChanges' from 'anki.collection' (/home/yaoretian/.local/lib/python3.10/site-packages/anki/collection.py)`

I have tried fixing the problem by restarting my computer again, reinstalling anki and uninstalling Ki but none of these have worked.

I could not find a similar topic when searching it up either. Does anyone know how to fix this?

---

<div class="post-metadata">

**Author:** ![BlackBeans](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/blackbeans/32/2283_2.png) [@BlackBeans](https://forums.ankiweb.net/u/BlackBeans)\
**Post date:** [August 24, 2022, 9:07am UTC](https://forums.ankiweb.net/t/importerror-when-opening-anki/22567/2 "2022-08-24T09:07:54Z")

</div>

How did you install Anki?

---

<div class="post-metadata">

**Author:** ![YaoReTian](https://avatars.discourse-cdn.com/v4/letter/y/e19b73/32.png) [@YaoReTian](https://forums.ankiweb.net/u/YaoReTian)\
**Post date:** [August 24, 2022, 2:44pm UTC](https://forums.ankiweb.net/t/importerror-when-opening-anki/22567/3 "2022-08-24T14:44:19Z")

</div>

From the AUR, using yay

`yay -Syu anki`

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [August 25, 2022, 6:41am UTC](https://forums.ankiweb.net/t/importerror-when-opening-anki/22567/4 "2022-08-25T06:41:48Z")

</div>

[https://docs.ankiweb.net/platform/linux/distro-packages.html](https://docs.ankiweb.net/platform/linux/distro-packages.html)

---

<div class="post-metadata">

**Author:** ![YaoReTian](https://avatars.discourse-cdn.com/v4/letter/y/e19b73/32.png) [@YaoReTian](https://forums.ankiweb.net/u/YaoReTian)\
**Post date:** [August 26, 2022, 9:19am UTC](https://forums.ankiweb.net/t/importerror-when-opening-anki/22567/5 "2022-08-26T09:19:55Z")

</div>

I’ve managed to fix the problem by installing the `anki-official-binary-bundle` from the AUR, which was the only package that worked out of every package I have tried

This solves the problem for now, and I hope the other packages may be fixed soon too

---

<div class="post-metadata">

**Author:** ![BlackBeans](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/blackbeans/32/2283_2.png) [@BlackBeans](https://forums.ankiweb.net/u/BlackBeans)\
**Post date:** [August 26, 2022, 2:12pm UTC](https://forums.ankiweb.net/t/importerror-when-opening-anki/22567/6 "2022-08-26T14:12:24Z")

</div>

There are two packages for Anki (AFAIK) that are currently maintained on AUR:

- The binary one, which fetches a precompiled, bundled version of Anki, and installs it.
- The “regular” one, which tries to use Arch’s packages as dependencies instead of the one bundled with Anki.

For technical reasons, doing a “regular” packaging of Anki has proved to be quite hard. Last time I checked, only two package managers / distributions claimed to have done so (and kept up with versions), one of which was Arch through AUR (but note this took quite some time: for some months, that package wasn’t available). So it’s not unlikely that the package broke again. Maybe you should submit this issue to the packager.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 4:05am UTC](https://forums.ankiweb.net/t/importerror-when-opening-anki/22567/7 "2023-05-01T04:05:26Z")

</div>


