# Bug in Anki 25.02: Bundled Qt6 libraries not found due to incorrect LD\_LIBRARY\_PATH call in launcher (+PROPOSED FIX)

**URL:** <https://forums.ankiweb.net/t/bug-in-anki-25-02-bundled-qt6-libraries-not-found-due-to-incorrect-ld-library-path-call-in-launcher-proposed-fix/55909>\
**Category:** Help\
**Created:** [February 16, 2025, 1:32pm UTC](https://forums.ankiweb.net/t/bug-in-anki-25-02-bundled-qt6-libraries-not-found-due-to-incorrect-ld-library-path-call-in-launcher-proposed-fix/55909 "2025-02-16T13:32:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brownbat](https://avatars.discourse-cdn.com/v4/letter/b/a183cd/32.png) [@brownbat](https://forums.ankiweb.net/u/brownbat)\
**Post date:** [February 16, 2025, 1:32pm UTC](https://forums.ankiweb.net/t/bug-in-anki-25-02-bundled-qt6-libraries-not-found-due-to-incorrect-ld-library-path-call-in-launcher-proposed-fix/55909/1 "2025-02-16T13:32:31Z")

</div>

Installing Anki 25.02 via included install script on Ubuntu 24.04.2 then running via “anki” generates the following error:

```python
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "aqt", line 63, in <module>
  File "aqt.gui_hooks", line 11, in <module>
  File "_aqt.hooks", line 18, in <module>
  File "aqt.qt", line 22, in <module>
  File "aqt.qt.qt6", line 12, in <module>
ImportError: /usr/lib/x86_64-linux-gnu/libQt6Core.so.6: version `Qt_6.6' not found (required by /usr/local/share/anki/lib/PyQt6/QtCore.abi3.so)

```

Anki bundles its own Qt6 libraries (which include the required Qt\_6.6 symbols) inside the installation directory (e.g., `/usr/local/share/anki/lib/PyQt6/Qt6/lib`). However, the launcher script sets `LD_LIBRARY_PATH` as follows:

```bash
export LD_LIBRARY_PATH="/usr/local/share/anki/lib:$LD_LIBRARY_PATH"

```

But qt 6.6 is bundled in a deeper subdirectory inside of anki/lib, so the dynamic linker just looks for it in system directories, completely bypassing the module’s RUNPATH ($ORIGIN/Qt6/lib)

So the system Qt6 libraries are loaded (6.4.2 on Ubuntu) leading to the error.

Fix is easy, just change the launcher script to include a pointer to the bundled PyQt6 folder as well as the broader lib folder:

```bash
export LD_LIBRARY_PATH="/usr/local/share/anki/lib/PyQt6/Qt6/lib:/usr/local/share/anki/lib:$LD_LIBRARY_PATH"

```

Users can apply this fix independently with:

```bash
sudo sed -i 's|/usr/local/share/anki/lib:|/usr/local/share/anki/lib/PyQt6/Qt6/lib:/usr/local/share/anki/lib:|' /usr/local/bin/anki

```

A long time ago I had developer access and would have just put this on github as a pull request but it’s been a few years since I’ve had any time to contribute.

Can one of the devs fold this in? It’s a pretty simple patch but it breaks the ability of nontechnical users to use the program at all without rolling back several versions.

I guess it’s specified in the launcher script and packaging process rather than the code itself… not quite sure where those changes start.

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [February 16, 2025, 5:04pm UTC](https://forums.ankiweb.net/t/bug-in-anki-25-02-bundled-qt6-libraries-not-found-due-to-incorrect-ld-library-path-call-in-launcher-proposed-fix/55909/2 "2025-02-16T17:04:51Z")

</div>

Is this already addressed by anything in the Platform Notes? [Install & Upgrade - Anki Manual](https://docs.ankiweb.net/platform/linux/installing.html)

---

<div class="post-metadata">

**Author:** ![Anon\_0000](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Anon\_0000](https://forums.ankiweb.net/u/Anon_0000)\
**Post date:** [February 16, 2025, 5:31pm UTC](https://forums.ankiweb.net/t/bug-in-anki-25-02-bundled-qt6-libraries-not-found-due-to-incorrect-ld-library-path-call-in-launcher-proposed-fix/55909/3 "2025-02-16T17:31:34Z")

</div>

No, I don’t think so.

But it’s weird that OP had to do this in ubuntu. Ubuntu is based on Debian and the install script works without issues on Debian (sid). Anki runs fine afterwards, too.

Maybe it’s something specific to ubuntu for some reason? Or regarding OPs setup?

---

<div class="post-metadata">

**Author:** ![brownbat](https://avatars.discourse-cdn.com/v4/letter/b/a183cd/32.png) [@brownbat](https://forums.ankiweb.net/u/brownbat)\
**Post date:** [February 16, 2025, 11:21pm UTC](https://forums.ankiweb.net/t/bug-in-anki-25-02-bundled-qt6-libraries-not-found-due-to-incorrect-ld-library-path-call-in-launcher-proposed-fix/55909/4 "2025-02-16T23:21:12Z")

</div>

Ah, great to hear this might be unique, didn’t realize.

So I’m testing on a clean install of Ubuntu 24.04.1 using virtualbox. I installed third party additions and ran apt update && apt upgrade, then just downloaded the latest and installed it using this command:

```bash
wget -O anki-25.02-linux-qt6.tar.zst https://github.com/ankitects/anki/releases/download/25.02/anki-25.02-linux-qt6.tar.zst && tar -I zstd -xf anki-25.02-linux-qt6.tar.zst && cd anki-25.02-linux-qt6 && sudo ./install.sh

```

then I get this error, slightly different than my first:

```bash
...
Install complete. Type 'anki' to run.
vm-user@vm-user-VirtualBox:~/anki-25.02-linux-qt6$ anki
Anki starting...
Initial setup...
Starting Anki 25.02...
Wayland support is disabled by default due to bugs:
https://github.com/ankitects/anki/issues/1767
You can force it on with an env var: ANKI_WAYLAND=1
Qt warning: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin. 
Qt info: Could not load the Qt platform plugin "xcb" in "" even though it was found. 
Qt fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb, wayland, eglfs, offscreen, vkkhrdisplay, minimal, wayland-egl, minimalegl, vnc, linuxfb.
 
Aborted (core dumped)

```

If I run

```bash
sudo apt install libxcb-cursor0

```

It fixes this issue and anki runs.

I wonder if having other sources of pyqt6 from other applications caused this… still investigating to see if i can reproduce it fully on a clean VM

---

<div class="post-metadata">

**Author:** ![Anon\_0000](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Anon\_0000](https://forums.ankiweb.net/u/Anon_0000)\
**Post date:** [February 16, 2025, 11:25pm UTC](https://forums.ankiweb.net/t/bug-in-anki-25-02-bundled-qt6-libraries-not-found-due-to-incorrect-ld-library-path-call-in-launcher-proposed-fix/55909/5 "2025-02-16T23:25:14Z")

</div>

> [@brownbat](#):
>
> If I run
> 
> ```auto
> sudo apt install libxcb-cursor0
> 
> ```
> 
> It fixes this issue and anki runs.

Oh, I see. In that case Danika\_Dakika was right after all – it is already covered in _Requirements_ from the link above. My debian sid vm has these dependencies installed already since I test and develop anki here.

---

<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:** [March 18, 2025, 11:25pm UTC](https://forums.ankiweb.net/t/bug-in-anki-25-02-bundled-qt6-libraries-not-found-due-to-incorrect-ld-library-path-call-in-launcher-proposed-fix/55909/6 "2025-03-18T23:25:38Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
