ModuleNotFoundError: No module named 'sdl2'

I try to run Tauon-music-box but it doesn't work, instead this message appears.

Traceback (most recent call last):
  File "/opt/tauon-music-box/tauon.py", line 8, in <module>
    from sdl2 import *
ModuleNotFoundError: No module named 'sdl2'

I've tried reinstalling but it didn't work.

inxi -Faz below

System:
  Kernel: 5.10.78.55.realtime1-1-rt-lts x86_64 bits: 64 compiler: gcc
    v: 11.1.0 parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-rt-lts
    root=UUID=92738ace-d95f-4f3e-9a50-f9170e33d3ba rw [email protected]
    quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
    systemd.unified_cgroup_hierarchy=1 loglevel=3
  Desktop: KDE Plasma 5.23.4 tk: Qt 5.15.2 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Desktop System: Gigabyte product: AX370M-DS3H v: N/A
    serial: <superuser required>
  Mobo: Gigabyte model: AX370M-DS3H-CF v: x.x serial: <superuser required>
    UEFI-[Legacy]: American Megatrends v: F22 date: 03/15/2018
CPU:
  Info: model: AMD Ryzen 5 2600 bits: 64 type: MT MCP arch: Zen+
    family: 0x17 (23) model-id: 8 stepping: 2 microcode: 0x800820D
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 576 KiB desc: d-6x32 KiB; i-6x64 KiB L2: 3 MiB desc: 6x512 KiB
    L3: 16 MiB desc: 2x8 MiB
  Speed (MHz): avg: 3834 high: 3864 min/max: 1550/3400 boost: enabled
    scaling: driver: acpi-cpufreq governor: performance cores: 1: 3864 2: 3860
    3: 3853 4: 3864 5: 3807 6: 3858 7: 3845 8: 3843 9: 3825 10: 3784 11: 3769
    12: 3842 bogomips: 81436
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl and seccomp
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional,
    STIBP: disabled, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
    vendor: XFX Pine driver: amdgpu v: kernel bus-ID: 08:00.0
    chip-ID: 1002:67df class-ID: 0300
  Display: x11 server: X.Org 1.21.1.2 compositor: kwin_x11 driver:
    loaded: amdgpu,ati unloaded: modesetting alternate: fbdev,vesa
    display-ID: :0 screens: 1
  Screen-1: 0 s-res: 2560x1440 s-dpi: 96 s-size: 677x381mm (26.7x15.0")
    s-diag: 777mm (30.6")
  Monitor-1: DisplayPort-0 res: 2560x1440 dpi: 93
    size: 697x392mm (27.4x15.4") diag: 800mm (31.5")
  OpenGL: renderer: AMD Radeon RX 580 Series (POLARIS10 DRM 3.40.0
    5.10.78.55.realtime1-1-rt-lts LLVM 13.0.0)
    v: 4.6 Mesa 21.3.1 direct render: Yes
Audio:
  Device-1: AMD Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]
    vendor: XFX Pine driver: snd_hda_intel v: kernel bus-ID: 08:00.1
    chip-ID: 1002:aaf0 class-ID: 0403
  Device-2: AMD Family 17h HD Audio vendor: Gigabyte driver: snd_hda_intel
    v: kernel bus-ID: 0a:00.3 chip-ID: 1022:1457 class-ID: 0403
  Sound Server-1: ALSA v: k5.10.78.55.realtime1-1-rt-lts running: yes
  Sound Server-2: JACK v: 1.9.19 running: no
  Sound Server-3: PulseAudio v: 15.0 running: no
  Sound Server-4: PipeWire v: 0.3.42 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Gigabyte driver: r8169 v: kernel port: f000 bus-ID: 04:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: enp4s0 state: down mac: <filter>
  Device-2: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: N/A
    modules: iwlwifi bus-ID: 07:00.0 chip-ID: 8086:24fb class-ID: 0280
  Device-3: Realtek RTL8814AU 802.11a/b/g/n/ac Wireless Adapter type: USB
    driver: rtl8814au bus-ID: 3-1:2 chip-ID: 0bda:8813 class-ID: 0000
    serial: <filter>
  IF: wlp9s0f3u1 state: up mac: <filter>
Drives:
  Local Storage: total: 2.04 TiB used: 165.88 GiB (7.9%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Western Digital
    model: WDS240G2G0A-00JH30 size: 223.58 GiB block-size: physical: 512 B
    logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 0000
    scheme: MBR
  ID-2: /dev/sdb maj-min: 8:16 vendor: Seagate model: ST2000DM006-2DM164
    size: 1.82 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    type: HDD rpm: 7200 serial: <filter> rev: CC26 scheme: MBR
Partition:
  ID-1: / raw-size: 223.58 GiB size: 223.58 GiB (100.00%)
    used: 165.88 GiB (74.2%) fs: btrfs dev: /dev/sda1 maj-min: 8:1
  ID-2: /home raw-size: 223.58 GiB size: 223.58 GiB (100.00%)
    used: 165.88 GiB (74.2%) fs: btrfs dev: /dev/sda1 maj-min: 8:1
  ID-3: /var/log raw-size: 223.58 GiB size: 223.58 GiB (100.00%)
    used: 165.88 GiB (74.2%) fs: btrfs dev: /dev/sda1 maj-min: 8:1
  ID-4: /var/tmp raw-size: 223.58 GiB size: 223.58 GiB (100.00%)
    used: 165.88 GiB (74.2%) fs: btrfs dev: /dev/sda1 maj-min: 8:1
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: zram size: 7.78 GiB used: 3.13 GiB (40.3%)
    priority: 100 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 40.4 C mobo: N/A gpu: amdgpu temp: 59.0 C
  Fan Speeds (RPM): N/A gpu: amdgpu fan: 769
Info:
  Processes: 370 Uptime: 10h 45m wakeups: 0 Memory: 7.78 GiB
  used: 2.83 GiB (36.3%) Init: systemd v: 249 tool: systemctl Compilers:
  gcc: 11.1.0 clang: 13.0.0 Packages: pacman: 1455 lib: 443 Shell: fish
  v: 3.3.1 running-in: kitty inxi: 3.3.11

As an AUR package this depends on several SDL2 library packages.

How did you install this package, and have you rebuilt it since the Python 3.10 update?

3 Likes

No. How can I do that?

Try this: https://wiki.archlinux.org/title/Arch_User_Repository#Installing_and_upgrading_packages

2 Likes

I followed the steps and it still ends up saying.

╭─[email protected] in ~ 
 ╰─λ tauon
Traceback (most recent call last):
  File "/opt/tauon-music-box/tauon.py", line 8, in <module>
    from sdl2 import *
ModuleNotFoundError: No module named 'sdl2'

Even tried reinstalling sdl2 and it didn't work.

I've just tried installing it myself and it works fine.

I'd try removing the package completely, and then building and installing again using makepkg to make sure it's built from scratch.

2 Likes

I no this is not recommended and you still haveing trouble with Tauon-music-box you can always install as a snap/flatpack

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