Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 645314 - app-misc/anki-2.1.0_beta27 USE=-recording - ModuleNotFoundError: No module named 'pyaudio'
Summary: app-misc/anki-2.1.0_beta27 USE=-recording - ModuleNotFoundError: No module na...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Patrick Lauer
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-22 02:12 UTC by glyphimor
Modified: 2021-06-02 01:03 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Output of emerge --info (file_645314.txt,5.67 KB, text/plain)
2018-01-22 02:12 UTC, glyphimor
Details
anki-2.1.0_beta27.ebuild with pyaudio edits (anki-2.1.0_beta27.ebuild,2.09 KB, text/plain)
2018-06-24 13:15 UTC, Fernando
Details

Note You need to log in before you can comment on or make changes to this bug.
Description glyphimor 2018-01-22 02:12:36 UTC
Created attachment 515800 [details]
Output of emerge --info

Some issues w/ 2 use flags on app-misc/anki-2.1.0_beta27. Flag descriptions are:

recording: Enable support for audio recording 
sound: Enable support for adding sound to cards 

However, looks like the ebuild ignores the sound flag. Additionally, the recording flag is mandatory -- anki won't run without it.

Tried emerging w/ both those disabled:

$ emerge -pv anki
[ebuild   R   ~] app-misc/anki-2.1.0_beta27::gentoo  USE="-latex -recording -sound {-test}" PYTHON_TARGETS="python3_6" 0 KiB

... but got an error trying to run anki:

$ anki
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.6/anki", line 6, in <module>
    import aqt
  File "/usr/lib64/python3.6/site-packages/aqt/__init__.py", line 4, in <module>
    from anki import version as _version
  File "/usr/lib64/python3.6/site-packages/anki/__init__.py", line 14, in <module>
    from anki.storage import Collection
  File "/usr/lib64/python3.6/site-packages/anki/storage.py", line 11, in <module>
    from anki.collection import _Collection
  File "/usr/lib64/python3.6/site-packages/anki/collection.py", line 26, in <module>
    from anki.sound import stripSounds
  File "/usr/lib64/python3.6/site-packages/anki/sound.py", line 261, in <module>
    import pyaudio
ModuleNotFoundError: No module named 'pyaudio'

Recompiled w/ sound flag added, and got the same error. Finally, compiled w/ recording flag added:

$ emerge -pv anki
[ebuild  N     ] media-libs/portaudio-19_pre20140130::gentoo  USE="alsa cxx -debug -jack -oss -static-libs" ABI_X86="(64) -32 (-x32)" 1,470 KiB
[ebuild  N     ] dev-python/pyaudio-0.2.11::gentoo  USE="-doc" PYTHON_TARGETS="python2_7 python3_4 python3_5 python3_6" 37 KiB
[ebuild   R   ~] app-misc/anki-2.1.0_beta27::gentoo  USE="recording* -latex -sound* {-test}" PYTHON_TARGETS="python3_6" 0 KiB

That got past the pyaudio error, although then got hit by other errors (e.g. 643004).
Comment 1 kapsh 2018-03-25 11:04:29 UTC
Same thing here.

Nobody wants to dig through all anki's source code to find why pyaduio is essential I guess, so how about just add unconditional dependency from pyaudio?
Comment 2 Fernando 2018-06-24 13:13:39 UTC
I edited sound.py and comment the out pyaudio references and have been running anki without problems although I have not fully tested it.

Attached is the modified ebuild I used to edit sound.py if the recording use flag is not selected.
Comment 3 Fernando 2018-06-24 13:15:24 UTC
Created attachment 537026 [details]
anki-2.1.0_beta27.ebuild with pyaudio edits
Comment 4 Larry the Git Cow gentoo-dev 2020-06-12 07:00:43 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bbf4348280a355c7def871019405fc563730ed7c

commit bbf4348280a355c7def871019405fc563730ed7c
Author:     Chris Burroughs <chris.burroughs@gmail.com>
AuthorDate: 2019-11-08 02:37:38 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2020-06-12 06:59:45 +0000

    app-misc/anki: bump to 2.1.15 and modernize ebuild
    
     - claiming maintainer timeout to update version and fix bugs, --juippis
    
     * Bump to EAPI 7
     * Enable python 3.{7,8} support
     * Fix missing test dependencies
     * Add missing jsonschema dependency
     * Backport argument fix to allow mpv versions > 0.31 to be used by anki
     * Correct and expand LICENSE
     * Resolve NonexistentDeps DEPEND warning (leftover from PyQtWebEngine split,
       but no version of PyQt5 with a webengine use flag is still in the tree.)
     * Use default pkg_setup from eclass and rely on default value for S variable
     * Clarify optional runtime dependencies needed (mpv OR mplayer)
     * Move optional runtime dependencies to optfeature
     * Adjust SRC_URL after upstream re-arranging
    
    NOTE: The upstream LICENSE includes "Qt's bundled translations: LGPL3", but
    since we are building from source that is not directly included.  More recent
    upstream versions have clarified this in the LICENSE file.
    
    Bug: https://bugs.gentoo.org/625894
    Bug: https://bugs.gentoo.org/645314
    Bug: https://bugs.gentoo.org/651472
    Bug: https://bugs.gentoo.org/688798
    Closes: https://bugs.gentoo.org/700010
    Closes: https://bugs.gentoo.org/715624
    Bug: https://bugs.gentoo.org/722502
    Bug: https://bugs.gentoo.org/724482
    Bug: https://bugs.gentoo.org/724990
    Closes: https://bugs.gentoo.org/726522
    
    Signed-off-by: Chris Burroughs <chris.burroughs@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/16054
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 app-misc/anki/Manifest                         |  1 +
 app-misc/anki/anki-2.1.15.ebuild               | 93 ++++++++++++++++++++++++++
 app-misc/anki/files/anki-2.1.15-mpv-args.patch | 26 +++++++
 3 files changed, 120 insertions(+)