You are not logged in.
Dear all,
I have just installed Anki from the official repos onto a recently installed Arch system (no prior install of Anki). I get this error when I try to run the program from the command line:
Traceback (most recent call last):
File "/usr/bin/anki", line 6, in <module>
import aqt
File "/usr/share/anki/aqt/__init__.py", line 4, in <module>
from anki import version as _version
File "/usr/share/anki/anki/__init__.py", line 11, in <module>
raise Exception("Anki requires a UTF-8 locale.")
Exception: Anki requires a UTF-8 locale.
I have tried some of the suggestions offered in this thread (of course, the issue is slightly different, but I tried to troubleshoot using roughly the same methods.)
Here is some output that may be useful:
uname -a
Linux thinkpad 4.9.62-1-lts #1 SMP Wed Nov 15 17:49:37 CET 2017 x86_64 GNU/Linux
localectl
System Locale: LANG=sv_SE.UTF-8
VC Keymap: se-lat6
X11 Layout: n/a
locale -a
C
POSIX
sv_SE.utf8
python2 -c "import sys; print sys.getfilesystemencoding()"
ANSI_X3.4-1968
grep -v '#' /etc/locale.gen
sv_SE.UTF-8 UTF-8
env | grep LANG
LANG=C
I'm not sure why python2 is encoded thus, or how I can change it, if that's the problem. I had a read through PEP 540 but still unsure what next steps to take.
SOLUTION: Install relevant Python modules for my Python distribution (Anaconda).
Last edited by osintusr (2017-11-25 15:06:24)
Offline
UPDATE
I ran the following command:
export LC_CTYPE=sv_SE.UTF-8
which seems to have fixed the UTF-8 error. However, when I run
anki
now I get the following error:
Traceback (most recent call last):
File "/usr/bin/anki", line 6, in <module>
import aqt
File "/usr/share/anki/aqt/__init__.py", line 4, in <module>
from anki import version as _version
File "/usr/share/anki/anki/__init__.py", line 14, in <module>
from anki.storage import Collection
File "/usr/share/anki/anki/storage.py", line 11, in <module>
from anki.collection import _Collection
File "/usr/share/anki/anki/collection.py", line 26, in <module>
from anki.sound import stripSounds
File "/usr/share/anki/anki/sound.py", line 258, in <module>
import pyaudio
ModuleNotFoundError: No module named 'pyaudio'
Is this an "upstream" problem?
Offline
The anki package requires the python-pyaudio package. You should have it, unless you've done something dumb like changing the "python" symlink.
Offline
python2 ...
stat /usr/lib/python3.6/site-packages/pyaudio.py
Offline
Hmm I'm confused now.
I installed python-pyaudio and python2-pyaudio but get the same error and
which python-pyaudio
shows it is not in the path.
I definitely haven't messed with any symlinks.
I had a similar issue with other programs because I had not installed the package corresponding to the lts kernel.
Offline
I have no idea what you expect to be in $PATH for a python library.
Offline
Fair point.
Offline
python --version
pacman -Qkk python-pyaudio
?
Last edited by seth (2017-11-25 14:53:16)
Offline
Ah could it be that I'm using
Python 3.6.3 :: Anaconda, Inc.
?
pacman -Qkk python-pyaudio
python-pyaudio: 14 total files, 0 altered files
Offline
Ah could it be that I'm using
Python 3.6.3 :: Anaconda, Inc.
?
Yes.
Offline