[SRU] anki crashed with ModuleNotFoundError in Noble
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
anki (Debian) |
New
|
Unknown
|
||||
anki (Ubuntu) | Status tracked in Oracular | |||||
Noble |
Fix Committed
|
Medium
|
Unassigned | |||
Oracular |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[ Impact ]
anki will crash immediately when executed by any user. The error displayed is:
$ anki
Traceback (most recent call last):
File "/usr/bin/anki", line 6, in <module>
import aqt
File "/usr/share/
from anki import version as _version
File "/usr/share/
from anki.storage import Collection
File "/usr/share/
from anki.collection import _Collection
File "/usr/share/
from anki.sound import stripSounds
File "/usr/share/
from anki.mpv import MPV, MPVBase
File "/usr/share/
from distutils.spawn import find_executable # pylint: disable=
^^^
ModuleNotFoundE
[ Test Plan ]
install anki.
execute anki from terminal
If the package is not fixed it will result in the above error.
With the fixed package, it will start and will display the language choice menu.
After language is selected, Anki screen will be displayed.
[ Where problems could occur ]
The use of find_executable from distutils has been replaced with which() from shutil. This is not an upstream patch as upstream has completely modified the code.
"which" should work similar to find_executable, both returns the path of the executable and so chances of regression due to this change is very less.
[ Other Info ]
From the Debian bug, it seems the Debian maintainer does not intend to remove distutils as there are already some more RC bugs. Packaging the new upstream version in Debian will automatically remove the distutils dependency in Debian.
[ Original Bug Description ]
anki fails to run with the error:
$ anki
Traceback (most recent call last):
File "/usr/bin/anki", line 6, in <module>
import aqt
File "/usr/share/
from anki import version as _version
File "/usr/share/
from anki.storage import Collection
File "/usr/share/
from anki.collection import _Collection
File "/usr/share/
from anki.sound import stripSounds
File "/usr/share/
from anki.mpv import MPV, MPVBase
File "/usr/share/
from distutils.spawn import find_executable # pylint: disable=
^^^
ModuleNotFoundE
ProblemType: Crash
DistroRelease: Ubuntu 24.04
Package: anki 2.1.15+
ProcVersionSign
Uname: Linux 6.8.0-22-generic x86_64
ApportVersion: 2.28.0-0ubuntu1
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Wed Apr 17 21:33:16 2024
ExecutablePath: /usr/bin/anki
InstallationDate: Installed on 2024-04-10 (7 days ago)
InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Beta amd64 (20240410)
InterpreterPath: /usr/bin/python3.12
PackageArchitec
ProcCmdline: /usr/bin/python3 /usr/bin/anki
Python3Details: /usr/bin/
PythonArgs: ['/usr/bin/anki']
PythonDetails: N/A
SourcePackage: anki
Title: anki crashed with ModuleNotFoundError in /usr/share/
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sudo users
information type: | Private → Public |
tags: | removed: need-duplicate-check |
Changed in anki (Ubuntu): | |
importance: | Undecided → Medium |
Changed in anki (Ubuntu): | |
status: | In Progress → Confirmed |
status: | Confirmed → In Progress |
Changed in anki (Ubuntu Noble): | |
status: | New → In Progress |
assignee: | nobody → Sudip Mukherjee (sudipmuk) |
importance: | Undecided → Medium |
Changed in anki (Ubuntu Oracular): | |
assignee: | Sudip Mukherjee (sudipmuk) → nobody |
status: | In Progress → Fix Committed |
summary: |
- anki crashed with ModuleNotFoundError in Noble + [SRU] anki crashed with ModuleNotFoundError in Noble |
description: | updated |
Changed in anki (Debian): | |
status: | Unknown → New |
Changed in anki (Ubuntu Noble): | |
assignee: | Sudip Mukherjee (sudipmuk) → nobody |
Distutils have been removed from Python 3.12 (https:/ /stackoverflow. com/questions/ 77233855/ why-did- i-get-an- error-modulenot founderror- no-module- named-distutils). This can be worked around by installing python3-setuptools.