Package Details: anki-git r9412.bc6ede7c1-1

Git Clone URL: https://aur.archlinux.org/anki-git.git (read-only, click to copy)
Package Base: anki-git
Description: Helps you remember facts (like words/phrases in a foreign language) efficiently
Upstream URL: http://ankisrs.net/
Keywords: anki memorise memory study
Licenses: AGPL3
Conflicts: anki, anki-official-binary-bundle, anki20
Provides: anki
Submitter: degeberg
Maintainer: DarkShadow44
Last Packager: DarkShadow44
Votes: 21
Popularity: 0.022877
First Submitted: 2017-02-12 11:51 (UTC)
Last Updated: 2022-05-03 20:51 (UTC)

Pinned Comments

DarkShadow44 commented on 2021-11-29 06:47 (UTC) (edited on 2021-12-08 20:10 (UTC) by DarkShadow44)

Common Issues - Read before reporting
Processing ./bazel-bin/qt/aqt/aqt-2.1.48-py3-none-any.whl
ERROR: Cannot install aqt 2.1.47 (from /var/cache/yay/anki-git/src/anki-git/bazel-bin/qt/aqt/aqt-2.1.47-py3-none-any.whl) and aqt 2.1.48 (from /var/cache/yay/anki-git/src/anki-git/bazel-bin/qt/aqt/aqt-2.1.48-py3-none-any.whl) because these package versions have conflicting dependencies.

Try deleting ~/.cache/bazel

If someone can provide a fix for those issues for the PKGBUILD I'd be thankful, but in the meantime I add this as FAQ.

Latest Comments

DarkShadow44 commented on 2022-04-13 17:13 (UTC)

@homocomputeris Just changing the dependencies to qt6 won't work, since I still will have the qt5 dependencies installed. Not sure how to make anki pick qt6.

homocomputeris commented on 2022-04-13 08:31 (UTC) (edited on 2022-04-13 11:27 (UTC) by homocomputeris)

@DarkShadow44

UPD: Seems that copypaste from/to Anki Qt6 doesn't work.

There is a Qt6 PKGBUILD (with other minor fixes too) in the comments below, which is basically changing qt5 to qt6 counterparts.

It seems that Anki doesn't depend on Java explicitly, because it was replaced by Rust.

Sorry, I did flag this because back then it didn't build even with the bazel cache removed, so it seemed that something had changed on the build process side.

DarkShadow44 commented on 2022-04-11 00:38 (UTC) (edited on 2022-04-11 00:43 (UTC) by DarkShadow44)

@homocomputeris Sure, how do you configure the build for qt6?

Also, please don't flag the package out of date for something addressed as pinned issue.

homocomputeris commented on 2022-04-10 20:07 (UTC)

I suggest switching it to Qt6 since 2.1.50 https://github.com/ankitects/anki/releases/tag/2.1.50

Qt6

The packaged builds now come in separate Qt5 and Qt6 versions. Each version
has some advantages and disadvantages.

The Qt6 version is built with a more recent graphics toolkit. Advantages
include:

    Various bugfixes.
    Native support for recent Apple Silicon Macs (faster, better battery life).
    Compatibility with recent glibc versions on Linux (fixes blank screens).
    Better HiDPI support on Linux.

DarkShadow44 commented on 2022-03-22 20:18 (UTC)

Just got the following error

  File "/usr/bin/anki", line 17, in <module>
    import aqt
  File "/usr/lib/python3.10/site-packages/aqt/__init__.py", line 69, in <module>
    from aqt.main import AnkiQt  # isort:skip
  File "/usr/lib/python3.10/site-packages/aqt/main.py", line 20, in <module>
    import aqt.mediasrv
  File "/usr/lib/python3.10/site-packages/aqt/mediasrv.py", line 18, in <module>
    import flask
  File "/usr/lib/python3.10/site-packages/flask/__init__.py", line 6, in <module>
    from . import json as json
  File "/usr/lib/python3.10/site-packages/flask/json/__init__.py", line 9, in <module>
    from jinja2.utils import htmlsafe_json_dumps as _jinja_htmlsafe_dumps
  File "/home/fabian/.local/lib/python3.10/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/home/fabian/.local/lib/python3.10/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/home/fabian/.local/lib/python3.10/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File "/home/fabian/.local/lib/python3.10/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/lib/python3.10/site-packages/markupsafe/__init__.py)

If you happen to get the same, try removing ~/.local/lib/python3.10/site-packages/jinja2

misc commented on 2022-02-17 23:00 (UTC)

No problem, thanks for the update! That workaround indeed also does the job (after said deletion of bazel's cache).

DarkShadow44 commented on 2022-02-17 20:05 (UTC)

Sorry, I didn't realize I forgot to push the update. Something must went wrong.

Please try again, after deleting the bazel cache.

misc commented on 2022-02-17 10:46 (UTC) (edited on 2022-02-17 10:48 (UTC) by misc)

Seems to be from the recent glibc updates, during which libcrypt.so.1 was removed: https://github.com/archlinux/svntogit-packages/commit/f1aeeaf4a3fabd9b5f8186005066e04f1aa7c672

Curious that it's still working for you. Anyway, there's libxcrypt-compat in the AUR that brings that library version back.

misc commented on 2022-02-16 22:01 (UTC)

Already done that. The error message is how that's failing.

Seems it's now trying to use its bundled python, which is built with an old libxcrypt, for whatever reason.

If it's building for you, could you please check if there's a /usr/lib/libcrypt.so.1 present on your system?

DarkShadow44 commented on 2022-02-16 19:18 (UTC)

Can you please test the latest update? You might need to delete "~/.cache/bazel/" though!

misc commented on 2022-02-16 10:20 (UTC)

Can't seem to build this since the changes of last week, now it instantly fails with

Error in fail: rules_python failed: (/{home}/.cache/bazel/_bazel_{…}/{hex}/external/python/python: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory

There's an outdated libxcrypt-compat in the AUR for that library, but this had never been an issue / required before. So probably not an issue with the PKGBUILD, either.

BTW, Anki moved to QT6 for active development in .50, it's mostly the same packages, just incremented.

DarkShadow44 commented on 2022-02-11 01:06 (UTC)

@greve Thanks for the notify, updated again.

greve commented on 2022-02-10 20:12 (UTC)

error in build():

==> Starting build()...
/home/nico/.cache/yay/anki-git/PKGBUILD: line 101: ./scripts/build: No such file or directory
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: anki-git

DarkShadow44 commented on 2022-02-09 22:46 (UTC)

@homocomputeris Thanks, pushed an update.

homocomputeris commented on 2022-02-06 18:13 (UTC)

Doesn't build anymore:

package()...
WARNING: Requirement 'bazel-bin/pylib/anki/anki-*.whl' looks like a filename, but the file does not exist
ERROR: anki-*.whl is not a valid wheel filename.

DarkShadow44 commented on 2021-12-13 23:56 (UTC)

@magnus-tesshu I don't know when or why it happens, I had it the last time I built it...

magnus-tesshu commented on 2021-12-13 22:38 (UTC) (edited on 2021-12-13 22:38 (UTC) by magnus-tesshu)

By the way DarkShadow, is bazel breaking the build still known to be an issue? It could almost certainly be resolved by setting one of XDG_CACHE_HOME or HOME environment variables in the PKGBUILD to /tmp/something.

If the issue doesn't happen consistently, it's best not to do that I think. It builds fine for me.

homocomputeris commented on 2021-12-12 18:53 (UTC) (edited on 2022-04-13 11:15 (UTC) by homocomputeris)

@magnus-tesshu Try this:

# Maintainer:  Fabian Maurer<dark.shadow4@web.de>
# Contributor: Martin Dünkelmann<nc-duenkekl3@netcologne.de>
# Contributor: Shaoyu Tseng<zandimna@autistici.org>
# Contributor: Daniel Egeberg <daniel.egeberg@gmail.com
# Contributor: Sławomir Kowalski <suawekk+aur@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Timm Preetz <timm@preetz.us>
# Contributor: Michael 'manveru' Fellinger <m.fellinger@gmail.com>
# Contributor: Dave Pretty <david dot pretty at gmail dot com>

pkgname=anki-git
pkgver=r9370.29c48a60e
pkgrel=1
pkgdesc="Helps you remember things (like words or phrases in a foreign language) efficiently"
url="https://apps.ankiweb.net/"
license=('AGPL3')
arch=('any')
provides=('anki')
conflicts=('anki' 'anki20' 'anki-official-binary-bundle')
depends=(
    # anki and aqt
    'python-beautifulsoup4'
    'python-requests'
    'python-wheel'

    # anki
    'python-pysocks' # requests[socks]
    'python-decorator'
    'python-protobuf'
    'python-orjson'
    'python-distro'
    'python-stringcase'

    # aqt
    'python-send2trash'
    'python-markdown'
    'python-jsonschema'
    'python-pyaudio'
    'python-pyqt6-webengine'
    'python-flask'
    'python-flask-cors'
    'python-waitress'
    'python-pyqt6'
)
makedepends=(
    'git'
    'rsync'

    'bazel'
    'clang'

    'maturin'
    'rust'

    'python-pip'
    'python-mypy-protobuf'
    'npm'
    'typescript'
    'jre11-openjdk'
)
optdepends=(
    'lame: record sound'
    'mpv: play sound (preferred)'
    'mplayer: play sound'
)
source=(
    $pkgname::git+https://github.com/dae/anki.git
)
sha512sums=('SKIP')

pkgver() {
    cd "$pkgname"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd "$pkgname"
    echo "build --action_env=PYO3_PYTHON=/usr/bin/python3" > "$srcdir/$pkgname/user.bazelrc"
}

build() {
    cd "$pkgname"

    export CC=/usr/bin/clang
    export CXX=/usr/bin/clang++
    export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
    ./tools/build
}

package() {
    cd "$pkgname"
    PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir" --ignore-installed --no-deps .bazel/out/dist/anki-*.whl .bazel/out/dist/aqt-*.whl

    install -Dm755 qt/runanki.py "$pkgdir"/usr/bin/anki
    install -Dm644 qt/bundle/lin/anki.desktop "$pkgdir"/usr/share/applications/anki.desktop
    install -Dm644 qt/bundle/lin/anki.png "$pkgdir"/usr/share/pixmaps/anki.png
}

magnus-tesshu commented on 2021-12-09 02:31 (UTC)

@homocomputeris how would one go about doing that?

homocomputeris commented on 2021-12-08 23:51 (UTC)

It can be successfully built with Qt6 now.

DarkShadow44 commented on 2021-12-08 20:09 (UTC)

Thanks, put the patch in!

magnus-tesshu commented on 2021-12-08 07:31 (UTC)

The following patch fixes the build:

 ╭─mag@magnus in repo: anki-git on  master [!] took 12s
 ╰─λ git --no-pager diff
diff --git a/PKGBUILD b/PKGBUILD
index ee10039..3b89b5a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,7 +9,7 @@
 # Contributor: Dave Pretty <david dot pretty at gmail dot com>

 pkgname=anki-git
-pkgver=r9014.5a3999d0c
+pkgver=r9064.ed5273fae
 pkgrel=1
 pkgdesc="Helps you remember facts (like words/phrases in a foreign language) efficiently"
 url="http://ankisrs.net/"
@@ -56,6 +56,8 @@ makedepends=(
     'python-mypy-protobuf'
     'npm'
     'typescript'
+
+    'jre11-openjdk'
 )
 optdepends=(
     'lame: record sound'
@@ -93,6 +95,9 @@ build() {

     export CC=/usr/bin/clang
     export CXX=/usr/bin/clang++
+
+    export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
+
     ./scripts/build
 }

It's just two lines, you can probably manually do it; add a makedepend for jre11-openjdk and export JAVA_HOME before running the build

DarkShadow44 commented on 2021-11-29 06:47 (UTC) (edited on 2021-12-08 20:10 (UTC) by DarkShadow44)

Common Issues - Read before reporting
Processing ./bazel-bin/qt/aqt/aqt-2.1.48-py3-none-any.whl
ERROR: Cannot install aqt 2.1.47 (from /var/cache/yay/anki-git/src/anki-git/bazel-bin/qt/aqt/aqt-2.1.47-py3-none-any.whl) and aqt 2.1.48 (from /var/cache/yay/anki-git/src/anki-git/bazel-bin/qt/aqt/aqt-2.1.48-py3-none-any.whl) because these package versions have conflicting dependencies.

Try deleting ~/.cache/bazel

If someone can provide a fix for those issues for the PKGBUILD I'd be thankful, but in the meantime I add this as FAQ.

DarkShadow44 commented on 2021-11-29 06:44 (UTC)

I'll take over maintenance. But please report any issues you have in the comments!

MartinX3 commented on 2021-11-27 18:15 (UTC)

I orphaned this package, since I've got not time and don't use anki anymore.

homocomputeris commented on 2021-11-01 21:46 (UTC) (edited on 2021-11-14 20:14 (UTC) by homocomputeris)

There is an error with the latest commit.

This PKGBUILD builds:

# Maintainer: Martin Dünkelmann<nc-duenkekl3@netcologne.de>
# Contributor: Shaoyu Tseng<zandimna@autistici.org>
# Contributor: Daniel Egeberg <daniel.egeberg@gmail.com
# Contributor: Sławomir Kowalski <suawekk+aur@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Timm Preetz <timm@preetz.us>
# Contributor: Michael 'manveru' Fellinger <m.fellinger@gmail.com>
# Contributor: Dave Pretty <david dot pretty at gmail dot com>

pkgname=anki-git
pkgver=r8971.311e70822
pkgrel=1
pkgdesc="Helps you remember facts (like words/phrases in a foreign language) efficiently"
url="http://ankisrs.net/"
license=('AGPL3')
arch=('any')
provides=('anki')
conflicts=('anki' 'anki20' 'anki-official-binary-bundle')
depends=(
    # anki and aqt
    'python-beautifulsoup4'
    'python-requests'
    'python-wheel'

    # anki
    'python-pysocks' # requests[socks]
    'python-decorator'
    'python-protobuf'
    'python-orjson'
    'python-distro'
    'python-stringcase'

    # aqt
    'python-send2trash'
    'python-markdown'
    'python-jsonschema'
    'python-pyaudio'
    'python-pyqtwebengine'
    'python-flask'
    'python-flask-cors'
    'python-waitress'
    'python-pyqt5'
)
makedepends=(
    'git'
    'rsync'

    'bazel'
    'clang'

    'maturin'
    'rust'

    'python-pip'
    'python-mypy-protobuf'
    'npm'
    'typescript'
)
optdepends=(
    'lame: record sound'
    'mpv: play sound. prefered over mplayer'
    'mplayer: play sound'
)
source=(
    $pkgname::git+https://github.com/dae/anki.git

    #ankitects-anki-core-i18n-master.tar.gz::https://github.com/ankitects/anki-core-i18n/tarball/master
    #ankitects-anki-desktop-ftl-master.tar.gz::https://github.com/ankitects/anki-desktop-ftl/tarball/master
    #ankitects-anki-desktop-i18n-master.tar.gz::https://github.com/ankitects/anki-desktop-i18n/tarball/master
)
sha512sums=('SKIP')

pkgver() {
    cd "$pkgname"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd "$pkgname"

    # Disable foring a specific bazel version to build with
    rm .bazelversion

    # Put translations in place.
    #ln -sf "$srcdir"/ankitects-anki-core-i18n-*/ rslib/ftl/repo
    #ln -sf "$srcdir"/ankitects-anki-desktop-ftl-*/ qt/ftl/repo
    #ln -sf "$srcdir"/ankitects-anki-desktop-i18n-*/ qt/po/repo
}

build() {
    cd "$pkgname"

    export CC=/usr/bin/clang
    export CXX=/usr/bin/clang++
    ./scripts/build
}

package() {
    cd "$pkgname"
    PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir" --ignore-installed --no-deps bazel-bin/pylib/anki/anki-*.whl bazel-bin/qt/aqt/aqt-*.whl

    install -Dm755 qt/runanki.py "$pkgdir"/usr/bin/anki
    install -Dm644 qt/package/lin/anki.desktop "$pkgdir"/usr/share/applications/anki.desktop
    install -Dm644 qt/package/lin/anki.png "$pkgdir"/usr/share/pixmaps/anki.png
}

ParaSait commented on 2021-10-26 13:16 (UTC) (edited on 2021-10-26 13:16 (UTC) by ParaSait)

I had a similar problem to ivs_er's. During the bazel stage, my build kept failing with the following error:

FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.ExceptionInInitializerError
        at com.google.devtools.build.lib.actions.ParameterFile.writeContent(ParameterFile.java:118)
        at com.google.devtools.build.lib.actions.ParameterFile.writeParameterFile(ParameterFile.java:111)
        at com.google.devtools.build.lib.analysis.actions.ParameterFileWriteAction$ParamFileWriter.writeOutputFile(ParameterFileWriteAction.java:175)
...

I have both jdk-openjdk (17.u35-1) and jdk11-openjdk (11.0.12.u7-1) installed. archlinux-java status indicates that java-17-openjdk from that first package is set as the default. I was able to fix the build problem by temporarily switching over to JDK11, using archlinux-java set java-11-openjdk.

(It seems this is not the only package suffering from this problem; I've had a similar problem with the same solution upon installing shattered-pixel-dungeon from the AUR, which needs to be compiled with java. I suppose with any java pkgbuilds just try switching your default JDK version and you'll likely fix the problem.)

MartinX3 commented on 2021-10-20 18:47 (UTC) (edited on 2021-10-20 18:49 (UTC) by MartinX3)

Bazel needs java.

But using java 17 I have javac.

myridium commented on 2021-10-19 06:00 (UTC)

Package broken. First it requires javac to build, which is not present in current versions of java. After setting the version of java manually so that javac is on PATH it then says:

ERROR: anki-2.1.49-cp39-abi3-manylinux_2_28_x86_64.whl is not a supported wheel on this platform.

ivs_er commented on 2021-09-03 13:33 (UTC)

2021-09-02 10:57 Solved by removing jdk 16 and letting yay install jdk 11.

ghorshy commented on 2021-09-02 15:57 (UTC)

OK, @DarkShadow44 's way worked. Removing ~/.cache/bezel fixed it.

MartinX3 commented on 2021-09-02 15:01 (UTC)

@ghorshy Just remove the old anki versions. Maybe the anki developers need to fix something.

ghorshy commented on 2021-09-02 14:36 (UTC)

Tried to update anki for few days but this error comes up:

ERROR: Cannot install anki 2.1.46 (from /home/manjaro/.cache/yay/anki-git/src/anki-git/bazel-bin/pylib/anki/anki-2.1.46-cp38-abi3-manylinux2014_x86_64.whl) and anki 2.1.47 (from /home/manjaro/.cache/yay/anki-git/src/anki-git/bazel-bin/pylib/anki/anki-2.1.47-cp38-abi3-manylinux2014_x86_64.whl) because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested anki 2.1.46 (from /home/manjaro/.cache/yay/anki-git/src/anki-git/bazel-bin/pylib/anki/anki-2.1.46-cp38-abi3-manylinux2014_x86_64.whl)
    The user requested anki 2.1.47 (from /home/manjaro/.cache/yay/anki-git/src/anki-git/bazel-bin/pylib/anki/anki-2.1.47-cp38-abi3-manylinux2014_x86_64.whl)

I tried to -Rns in yay but now I can't install this package at all.

MartinX3 commented on 2021-09-02 11:03 (UTC)

@ivs_er If it's new, please open an issue ticket.

Or you need maybe java 16?

ivs_er commented on 2021-09-02 10:57 (UTC)

Getting a bazel error while building the latest version, stack trace:

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make java.lang.String(byte[],byte) accessible: module java.base does not "opens java.lang" to unnamed module @9353778
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:188)
    at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:181)
    at com.google.devtools.build.lib.unsafe.StringUnsafe.<init>(StringUnsafe.java:75)
    at com.google.devtools.build.lib.unsafe.StringUnsafe.initInstance(StringUnsafe.java:56)
    at com.google.devtools.build.lib.unsafe.StringUnsafe.<clinit>(StringUnsafe.java:37)
    ... 19 more

MartinX3 commented on 2021-08-31 20:36 (UTC)

@DarkShadow44 Yes, exactly, I thought the version variable would be useless and the aur helper would anyway generate the correct version, instead of showing you the static version.

DarkShadow44 commented on 2021-08-31 20:33 (UTC)

Yes, now it doesn't show it as changed. But you went back to the old versioning scheme, right?

MartinX3 commented on 2021-08-31 17:51 (UTC)

@DarkShadow44 Hmmm, i thought the default pkgver variable is useless, if I use the pgkver() function. Does it work now?

DarkShadow44 commented on 2021-08-31 16:37 (UTC) (edited on 2021-08-31 16:37 (UTC) by DarkShadow44)

Sorry, I don't really understand how the helper(s) do that. I just know that yay isn't the only one to flag anki-git as changed, despite it not being changed.

MartinX3 commented on 2021-08-31 11:09 (UTC) (edited on 2021-08-31 11:09 (UTC) by MartinX3)

@DarkShadow44 I just switched the dummy version of this package to the real anki version to not get confused with package updates.

But the real version of this package should be generated by the "pkgver()" function in the PKGBUILD and be used by your AUR helper.

Or did I read the wiki wrong? VCS_package_guidelines#The_pkgver()_function

DarkShadow44 commented on 2021-08-30 22:26 (UTC)

Hey, stupid question, but yay always shows this package as changed: r8319.ab20f215b-1 -> 2.1.47-1 Any idea why that is? It used to work before.

MartinX3 commented on 2021-08-30 16:59 (UTC)

@DarkShadow44 you're welcome :)

Probably a basel bug not removing the old version, since it's both aqt, just with different minor versions. O.o

DarkShadow44 commented on 2021-08-30 16:28 (UTC) (edited on 2021-08-30 16:28 (UTC) by DarkShadow44)

Thanks! Just a small heads up, I got a strange issue when building, like

Processing ./bazel-bin/qt/aqt/aqt-2.1.48-py3-none-any.whl
ERROR: Cannot install aqt 2.1.47 (from /var/cache/yay/anki-git/src/anki-git/bazel-bin/qt/aqt/aqt-2.1.47-py3-none-any.whl) and aqt 2.1.48 (from /var/cache/yay/anki-git/src/anki-git/bazel-bin/qt/aqt/aqt-2.1.48-py3-none-any.whl) because these package versions have conflicting dependencies.

I solved it by deleting ~/.cache/bazel

Just in case someone has the same problem...

MartinX3 commented on 2021-08-29 23:01 (UTC) (edited on 2021-08-29 23:05 (UTC) by MartinX3)

@DarkShadow44 Thank you I must be blind

I updated the package now, thank you :)

DarkShadow44 commented on 2021-08-29 21:21 (UTC) (edited on 2021-08-29 21:22 (UTC) by DarkShadow44)

Yes, it crashes on startup with this log:

  File "/usr/bin/anki", line 16, in <module>
    import aqt
  File "/usr/lib/python3.9/site-packages/aqt/__init__.py", line 18, in <module>
    from anki.collection import Collection
  File "/usr/lib/python3.9/site-packages/anki/collection.py", line 19, in <module>
    from anki._legacy import DeprecatedNamesMixin, deprecated
  File "/usr/lib/python3.9/site-packages/anki/_legacy.py", line 12, in <module>
    import stringcase

That got introduced in commit 0ddd316388 (2021-06-26). It compiles fine btw, just running won't work.

MartinX3 commented on 2021-08-29 20:05 (UTC) (edited on 2021-08-29 20:06 (UTC) by MartinX3)

Please explain why you flag a git aur package as "out of date", since it uses pkgver() to dynamical calculate its version number.

@DarkShadow44 are you sure? I don't find this change in the source code and last time i was able to compile it without this dependency. (Currently I'm in holidays for 2 weeks with 1mbit internet and can't test it without running in a timeout while fetching the dependencies)

DarkShadow44 commented on 2021-08-28 21:40 (UTC)

Since the latest update(s), this depends on python-stringcase.

MartinX3 commented on 2021-08-24 16:00 (UTC) (edited on 2021-08-24 16:26 (UTC) by MartinX3)

Package is probably broken until this gets fixed: https://github.com/ankitects/anki/issues/1338

Ah, fixed by removing the folder ~/.local/lib/python3.9/ Dunno why it was corrupted at my site.

MartinX3 commented on 2021-08-24 16:00 (UTC)

Perfect. I recommend to remove python2 from your system.

matejdro commented on 2021-08-24 06:46 (UTC)

Thanks. The issue for me was that pip was pointing to python 2.7 pip instead of the new one. python2 -m pip uninstall pip and then reinstalling python-pip package fixed the issue.

MartinX3 commented on 2021-08-22 10:09 (UTC)

@matejdro It builds here without this error. I think a python 2.7 package is hiding on your system and wants to survive. :P Or something you installed with pip systemwide.

But I get a different compile issue https://github.com/ankitects/anki/issues/1338

matejdro commented on 2021-08-22 09:36 (UTC) (edited on 2021-08-22 09:46 (UTC) by matejdro)

I'm getting this when I attempt to build. Any ideas?

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
ERROR: anki-2.1.47-cp38-abi3-manylinux2014_x86_64.whl is not a supported wheel on this platform.

It is weird that there is a warning message about Python 2.7 there because I have Python 3.9.6 installed.

drew33 commented on 2021-05-11 11:22 (UTC)

@MarkWalters.pw - I also get the conflicting dependencies and it turns out you don't need to rm -rf ~/.cache/bazel. Just deleting the older files is enough. In my case (slightly newer conflicts), simply the following:

rm ~/.cache/yay/anki-git/src/anki-git/bazel-bin/pylib/anki/anki-2.1.43-cp38-abi3-manylinux2014_x86_64.whl
rm ~/.cache/yay/anki-git/src/anki-git/bazel-bin/qt/aqt/aqt-2.1.43-py3-none-any.whl

DarkShadow44 commented on 2021-05-02 20:53 (UTC)

I've found a problem where anki doesn't show the menu in it's top bar (the one with Decks/Add/Browse). You can work around that by Tools->Preferences->Video Driver: OpenGL.

MartinX3 commented on 2021-04-29 11:22 (UTC)

@homocomputeris

I can't reproduce it. It works here.

Is there any package missing in the dependencies which isn't installed on your system? https://github.com/ankitects/anki/blob/main/docs/development.md

homocomputeris commented on 2021-04-26 20:00 (UTC)

Fails to build:

build()...
FATAL: Could not find system javabase. Ensure JAVA_HOME is set, or javac is on your PATH.

because

(Arch does not use JAVA_HOME, it uses archlinux-java to set the /usr/bin/java symlink).

MarkWalters.pw commented on 2021-03-12 17:40 (UTC)

Just a FYI, in case anyone else gets this problem. ERROR: Cannot install aqt 2.1.41 (<snip>) and aqt 2.1.43 (<snip>) because these package versions have conflicting dependencies. Tried manual makepkg and removed aqt-2.1.41-py3-none-any.whl in src after a failed build. Same problem. Then tried the dreaded rm -rf ~/.cache/bazel so it would redownload all 3.6G worth of the redundant build files. Which allowed it to install. Then when I run anki I got: Qt warning: Could not find the Qt platform plugin "xcb" in "" That error was fixed with a pacman -Syyu https://pastebin.com/C8cPhnV5

MartinX3 commented on 2021-03-01 11:51 (UTC)

@lmat that looks like a download error Maybe your internet or their download server has a bug.

lmat commented on 2021-02-28 21:35 (UTC)

Fails to fetch pyqt5 with the following error: https://paste.rs/VnP

I have python-pyqt5 installed, but it looks like bezel wants its own copy?

MartinX3 commented on 2021-02-25 13:39 (UTC)

You're welcome. :)

Rumpelstilzchen commented on 2021-02-25 13:35 (UTC)

Great! Thanks for maintaining the package :-)

MartinX3 commented on 2021-02-25 11:27 (UTC)

@Rumpelstilzchen Thank you :) I hope it is now fixed for everyone! :D

Rumpelstilzchen commented on 2021-02-24 18:10 (UTC)

Correct me if I’m wrong, but I think the paths of the three install commands in package() are outdated. Instead of

install -Dm755 qt/runanki "$pkgdir"/usr/bin/anki
install -Dm644 qt/anki.desktop "$pkgdir"/usr/share/applications/anki.desktop
install -Dm644 qt/anki.png "$pkgdir"/usr/share/pixmaps/anki.png

one should have

install -Dm755 qt/runanki.py "$pkgdir"/usr/bin/anki
install -Dm644 qt/linux/anki.desktop "$pkgdir"/usr/share/applications/anki.desktop
install -Dm644 qt/linux/anki.png "$pkgdir"/usr/share/pixmaps/anki.png

Without changing them I get the same problem as @MartinX3, while with the new paths the package seems to install fine.

MartinX3 commented on 2021-01-02 11:40 (UTC) (edited on 2021-01-02 11:40 (UTC) by MartinX3)

Ah, now I can finally compile it on my laptop as well

Sadly it stops now with

==> Beginne package()...
Processing ./bazel-bin/pylib/anki/anki-2.1.39-cp38-abi3-manylinux2014_x86_64.whl
Processing ./bazel-bin/qt/aqt/aqt-2.1.39-py3-none-any.whl
Installing collected packages: anki, aqt
  WARNING: The script anki is installed in '/tmp/makepkg/anki-git/pkg/anki-git/usr/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed anki-2.1.39 aqt-2.1.39
install: der Aufruf von stat für 'qt/runanki' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
==> FEHLER: Ein Fehler geschah in package().
    Breche ab...

MartinX3 commented on 2021-01-02 11:34 (UTC)

@misc Thank you and done :)

misc commented on 2020-12-22 20:15 (UTC)

It's possible (not necessary) now to abbreviate the two bazel runs into one bazel build -c opt dist.

Problematic however is the .bazelversion, as it breaks building with higher versions unless manually matched (atm: 3.7.0 → 3.7.2). I guess just rm'ing the file works, too.

MartinX3 commented on 2020-12-10 11:52 (UTC)

Hmm, laptop i7-6700HQ here and my ram isn't full and I compile on a SSD. And since we both use arch we should have the same package versions. Weird.

misc commented on 2020-12-10 03:34 (UTC)

It works fine for me (i7 4770). No idea why it fails for you, sorry.

MartinX3 commented on 2020-12-09 15:10 (UTC)

@misc Thank you, the package() is updated.

But sadly my building hangs at [698 / 1,093] Building rust worker [for host]; 757s linux-sandbox even without the "-c opt" flag

So someone else should test it and report bugs. :)

misc commented on 2020-12-08 00:35 (UTC)

@MartinX3: oof, no idea why it does that for you (you could try compiling without -c opt just to see if it works, but the binary will be considerably slower).

However, it seems you did not update package() — the old pip install will fail.

MartinX3 commented on 2020-12-07 17:21 (UTC)

@misc thank you a lot :D

I pushed an update, but sadly I can't test it correctly After several attempts it seem to loop or compile at this step (this time canceled earlier) [712 / 1,107] Building rust worker [for host]; 553s linux-sandbox

Or my laptop is too slow

misc commented on 2020-12-07 13:35 (UTC) (edited on 2020-12-07 22:03 (UTC) by misc)

New build instructions for 2.1.36:

build() {
    export CC=/usr/bin/clang
    export CXX=/usr/bin/clang++
    cd anki-$pkgver
    bazel build -c opt //pylib/anki:wheel
    bazel build -c opt //qt/aqt:wheel
}

package() {
    cd anki-$pkgver
    PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir" --ignore-installed --no-deps bazel-bin/pylib/anki/anki-*.whl bazel-bin/qt/aqt/aqt-*.whl
}

Obviously they still could use a cleanup. The export is necessary with ccache as it otherwise fails trying to access outside bazel's sandbox. Note that bazel itself will write outside the srcdir into ~/.cache/bazel.

depends & co. also need to be updated as in Community's package + bazel.

e: @MartinX3, oof, no idea why it does that for you (you could try compiling without -c opt just to see if it works, but the binary will be considerably slower). However, it seems you did not update package() — the old pip install will fail.

prometheus commented on 2020-11-10 13:02 (UTC)

It fails to build.

==> Starting build()...
  -> Building UI
/home/[redacted]/.cache/yay/anki-git/PKGBUILD: line 34: ./tools/build_ui.sh: No such file or directory
==> ERROR: A failure occurred in build().
    Aborting...
error making: anki-git

MartinX3 commented on 2020-09-24 16:57 (UTC)

Seems like the developers of anki doesn't provide a way to generate their provided binary bundle. It's only possible to run anki directly from code, which makes it impossible (?) to write an installation routine.

MartinX3 commented on 2020-08-23 10:56 (UTC)

Broken

==> Beginne pkgver()... ==> Aktualisierte Version: anki-git r5005.13476503-1 ==> Beginne build()... -> Building UI /var/tmp/pamac-build-martin/anki-git/PKGBUILD: Zeile 34: ./tools/build_ui.sh: Datei oder Verzeichnis nicht gefunden ==> FEHLER: Ein Fehler geschah in build(). Breche ab...

nikos commented on 2019-10-07 14:48 (UTC) (edited on 2019-10-10 09:39 (UTC) by nikos)

When I try to start Anki, I unfortunately get the following error: python3: relocation error: /usr/lib/python3.7/site-packages/PyQt5/Qt/plugins/platforms/../../lib/libQt5XcbQpa.so.5: symbol _ZN20QPlatformIntegration11screenAddedEP15QPlatformScreenb version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference Do you maybe have an idea how to fix it? Thank you very much!

EDIT: I fixed the problem. Removing the folder usr/lib/python3.7/site-packages/PyQt5/Qt solved it.

1over137 commented on 2019-02-13 12:19 (UTC) (edited on 2019-02-13 12:20 (UTC) by 1over137)

@misc Apparently this is reporting an error due to a module change for a workaround, add " from PyQt5.QtWebEngineWidgets import * " to the file /usr/share/anki/aqt/webview.py

Please leave a comment for any further errors

misc commented on 2019-02-10 19:31 (UTC) (edited on 2019-02-10 19:54 (UTC) by misc)

Unfortunately, pyqt5 kills support for the required QtWebEngine with today's 5.12.

e: Ah, it's "just" separated out into the new python-pyqtwebengine package. Inverted commas since it's still crashing with "'QWebEngineView' is not defined" for me.

1over137 commented on 2018-11-13 10:06 (UTC)

Updated it according to current Makefile. It should build now.

linkmauve commented on 2018-07-27 12:29 (UTC)

Hi, please pull this repository: https://git.linkmauve.fr/linkmauve/anki-git

I fixed all issues happening when installing Anki; it still doesn’t run though, because it requires Qt 5.9 and ArchLinux provides 5.11.

DarkShadow44 commented on 2018-05-26 13:09 (UTC)

Still doesn't build.

DarkShadow44 commented on 2018-04-12 21:21 (UTC)

Doesn't build anymore. mv: cannot stat 'tools/runanki.system': No such file or directory

prometheus commented on 2018-02-19 21:52 (UTC) (edited on 2018-02-19 21:53 (UTC) by prometheus)

Gives following error when started:

Traceback (most recent call last):

  File "/usr/bin/anki", line 6, in <module>

    import aqt

  File "/usr/share/anki/aqt/__init__.py", line 14, in <module>

    from aqt.qt import *

  File "/usr/share/anki/aqt/qt.py", line 44, in <module>

    raise Exception("Qt 5.10 is known to be buggy.")

Exception: Qt 5.10 is known to be buggy.

KerrickStaley commented on 2017-12-24 18:37 (UTC)

This now depends on python-markdown.

Without that package installed, I get the following error on program start:

Error during startup: Traceback (most recent call last): File "/usr/share/anki/aqt/main.py", line 51, in init self.setupAddons() File "/usr/share/anki/aqt/main.py", line 616, in setupAddons import aqt.addons File "/usr/share/anki/aqt/addons.py", line 8, in <module> import markdown ModuleNotFoundError: No module named 'markdown'</module>

seo.disparate commented on 2017-08-15 04:09 (UTC)

'python-decorator' now appears to be a dependency of anki-git.

DarkShadow44 commented on 2017-06-02 16:41 (UTC)

Since updating to qt5.9(testing) some shortcuts are broken, the number keys (1-4) can't be used anymore to rate the cards as hard/good/easy anmore. strg-z is also affected. Downgrading to non-testing qt5.8 fixes the issue. Don't know if this is an anki issue or an qt issue though. Can someone confirm?

dequis commented on 2017-03-31 14:49 (UTC)

The relevant bug that caused 5.8 to be marked as "broken" is now closed https://bugreports.qt.io/browse/QTBUG-58362 And it's been backported to arch as 5.8.0-5 https://bugs.archlinux.org/task/53444 Unfortunately the version check of this package checks for 5.8.0 and has no way to know that arch's 5.8.0-5 contains this fix. So until 5.8.1 happens, the workaround from the previous comment is still needed (remove the offending line)

kojin commented on 2017-02-26 22:04 (UTC) (edited on 2017-02-26 22:08 (UTC) by kojin)

This is currently broken as the git version of Anki expects qt5-base to be 5.7 and the current version as of writing is 5.8. Apparently the devs believe qt 5.8 is broken. You have two options: 1) roll back qt5-base and qt5-webengine to 5.7 2) comment the offending line of code in aqt/qt.py line 43 (https://github.com/dae/anki/blob/master/aqt/qt.py#L43) Edit: I should add that if you modify qt.py you will likely run into the issue the devs ran into.

aphirst commented on 2017-02-25 13:44 (UTC)

[adam@rakka ~]$ anki Traceback (most recent call last): File "/usr/bin/anki", line 6, in <module> import aqt File "/usr/share/anki/aqt/__init__.py", line 14, in <module> from aqt.qt import * File "/usr/share/anki/aqt/qt.py", line 43, in <module> raise Exception("Your Qt version is known to be broken.") Exception: Your Qt version is known to be broken. Is there anything we can do about this?

verant commented on 2017-02-13 21:33 (UTC)

Probably needs qt5-webengine doesn't work on my system otherwise