You are not logged in.
Pages: 1
Topic closed
Traceback (most recent call last):
File "/usr/bin/anki", line 5, in <module>
import aqt
File "/usr/share/anki/aqt/__init__.py", line 12, in <module>
from aqt.qt import *
File "/usr/share/anki/aqt/qt.py", line 10, in <module>
from anki.utils import isWin, isMac
File "/usr/share/anki/anki/__init__.py", line 14, in <module>
raise Exception("Anki requires a UTF-8 locale.")
Exception: Anki requires a UTF-8 locale.
Not sure what this means or how to trouble shoot, any help would be appreciated. Still a little bit of a noob. Thanks!
Last edited by charli3 (2015-06-10 01:01:13)
Offline
Offline
When posting configs, code or command output, please use [ code ] tags, not [ quote ] tags https://bbs.archlinux.org/help.php#bbcode
like this
It makes the code more readable and - in case of longer listings - more convenient to scroll through.
Post the output of
uname -a
localectl
locale -a
Offline
Will do!
Offline
Sorry it took me a while to get back to this but here's the output you asked for.
uname -a
Linux charli3-cpu 4.0.4-2-ARCH #1 SMP PREEMPT Fri May 22 03:05:23 UTC 2015 x86_64 GNU/Linux
localectl
System Locale: LANG=en_US.UTF-8
VC Keymap: n/a
X11 Layout: n/a
locale -a
C
POSIX
en_US.utf8
Offline
Why POSIX has precedence over en_US.utf8? Can you also post the output of the following commands?
python2 -c "import sys; print sys.getfilesystemencoding()"
grep -v '#' /etc/locale.gen
env | grep LANG
Last edited by mauritiusdadd (2015-06-08 15:12:15)
Offline
No problem.
$ python2 -c "import sys; print sys.getfilesystemencoding()"
UTF-8
$ grep -v '#' /etc/locale.gen
en_US.UTF-8 UTF-8
$ env | grep LANG
LANG=en_US.UTF-8
(Is that Spock piped through Sherlock with Holmes args?)
Last edited by charli3 (2015-06-09 13:27:42)
Offline
Ok, this is wierd...
From the traceback you posted an exception is raised in /usr/share/anki/anki/__init__.py at line 14. Now looking at that file we can see that the exception is raised whenever the function sys.getfilesystemencoding().lower() returns the string ascii or ansi_x3.4-1968:
if sys.version_info[0] > 2: raise Exception("Anki should be run with Python 2") elif sys.version_info[1] < 6: raise Exception("Anki requires Python 2.6+") elif sys.getfilesystemencoding().lower() in ("ascii", "ansi_x3.4-1968"): raise Exception("Anki requires a UTF-8 locale.")
However this output
$ python2 -c "import sys; print sys.getfilesystemencoding()" UTF-8
shows that the function sys.getfilesystemencoding() returns UTF-8 and thus the exception shouldn't occur
Did you execute anki in a terminal different from the one in wich you executed the command I posted? Can you please try again to run this commands
python2 -c "import sys; print sys.getfilesystemencoding()" && anki
and see what happen?
PS:
(Is that Spock piped through Sherlock with Holmes args?)
I think you're right
Offline
It was the same terminal I believe.
$ python2 -c "import sys; print sys.getfilesystemencoding()" && anki
UTF-8
Not sure what changed...Anki is now running without error. Thanks for your help mauritiusdadd!
Last edited by charli3 (2015-06-10 01:02:54)
Offline
I am getting the same error when trying to run anki. I am using ubuntu on a chromebook, so that may be the problem lol, but i tried your commands and the output wasnt quite the same as the OP, if your still around after 3 years.
I just installed ubuntu today, so uber noob right now.
troubleshooting go!
Offline
I am using ubuntu on a chromebook, so that may be the problem lol
Did you not read the notice when you signed up, or did you choose to ignore it? We only support Arch. https://wiki.archlinux.org/index.php/Co … pport_ONLY
troubleshooting go!
Not happening.
Closing
Offline
Pages: 1
Topic closed