Impossible to install anki Python backend on Raspberry Pi

Hello everyone!

I was trying to self-host my Anki back-end (= sync server) on my personal Raspberry Pi.

Here is my software information

  • cat /proc/version

Linux version 6.1.21-v8+ (dom@buildbot) (aarch64-linux-gnu-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023

  • cat /sys/firmware/devicetree/base/model

Raspberry Pi 4 Model B Rev 1.4

As Raspberry Pi comes with Python, and I read on the Anki docs (https://docs.ankiweb.net/sync-server.html#with-pip) it has a Python distribution, I decided to install it this way.

However, it looks like it doesn’t work on my RasPy, and I can’t figure out why.


When installing it via pip, I can only install the versions up to 2.1.35

(syncserver) user@raspberrypi:~/syncserver/bin $ pip3 install anki==25.7.5
ERROR: Could not find a version that satisfies the requirement anki==25.7.5 (from versions: 2.1.24+359b9f5c, 2.1.25, 2.1.26, 2.1.28, 2.1.29, 2.1.30, 2.1.31, 2.1.32, 2.1.33, 2.1.34, 2.1.35)
ERROR: No matching distribution found for anki==25.7.5

(I checked and version 25.7.5 does exist on PyPi.)

The problem is, this old version requires the now deprecated ankirspy module, that I can’t even install anymore.

As you can see, ankirspy is required:

(syncserver) user@raspberrypi:~/syncserver/bin $ SYNC_USER1=user:pass python -m anki.syncserver
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "/home/user/syncserver/lib/python3.11/site-packages/anki/__init__.py", line 7, in <module>
    from anki.storage import Collection
  File "/home/user/syncserver/lib/python3.11/site-packages/anki/storage.py", line 11, in <module>
    from anki.collection import _Collection
  File "/home/user/syncserver/lib/python3.11/site-packages/anki/collection.py", line 19, in <module>
    import anki.find
  File "/home/user/syncserver/lib/python3.11/site-packages/anki/find.py", line 9, in <module>
    from anki.hooks import *
  File "/home/user/syncserver/lib/python3.11/site-packages/anki/hooks.py", line 20, in <module>
    from anki.cards import Card
  File "/home/user/syncserver/lib/python3.11/site-packages/anki/cards.py", line 15, in <module>
    from anki.rsbackend import BackendCard
  File "/home/user/syncserver/lib/python3.11/site-packages/anki/rsbackend.py", line 32, in <module>
    import ankirspy  # pytype: disable=import-error
    ^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'ankirspy'

However, it was not installed during the pip install anki command, and it won’t install by itself either, because it is deprecated:

(syncserver) user@raspberrypi:~/syncserver/bin $ pip install ankirspy
ERROR: Could not find a version that satisfies the requirement ankirspy (from versions: none)
ERROR: No matching distribution found for ankirspy

So, what should I do to install Anki server on my Raspberry Pi? I don’t want to install the whole Anki Desktop application as I never physically use my Raspberry Pi. Is it even possible? Or are the docs outdated? What am I doing wrong?

Thanks

1 Like