stefano franchi
2014-06-01 18:24:40 UTC
Dear All:
I am trying to use lyxpak and it fails due to python-related issues. This
happens both in lyx2.1 and 2.0. I think it maybe a platform-specific issue
(Arch) due to some environmental variables not set by default, or to some
python2/python3 conflict. At any rate, I can't figure out how to fix it.
Here is the error message:
12:56:57.302: Fatal Python error: Py_Initialize: Unable to get the locale
encoding
12:56:57.303: File "/usr/lib/python2.7/encodings/__init__.py", line 123
12:56:57.304: raise CodecRegistryError,\
12:56:57.305: ^
12:56:57.306: SyntaxError: invalid syntax
which is puzzling, since it seems to say that there is a problem with the
syntax of the raise statement. Source code of the encodings file:
if not isinstance(entry, codecs.CodecInfo):
if not 4 <= len(entry) <= 7:
raise CodecRegistryError,\
'module "%s" (%s) failed to register' % \
(mod.__name__, mod.__file__)
As far as I can tell, the syntax of raise used here is indeed wrong if used
in python 3 (where raise Exception("excp") should be used). But why is
python 3 called at all, when lyxpak is correctly called as
/usr/bin/python2 -tt "/usr/local/share/lyx-2.1/scripts/lyxpak.py" ?
Secondly, the fact that the encodings module tries to raise an exception
means it has failed to find the correct module, I think.
So the two problems are most likely just one problem, due to some
interaction between python2 and python 3 on my system.
Any suggestion?
Cheers,
Stefano
--
__________________________________________________
Stefano Franchi
Associate Research Professor
Department of Hispanic Studies Ph: +1 (979) 845-2125
Texas A&M University Fax: +1 (979) 845-6421
College Station, Texas, USA
***@tamu.edu
http://stefano.cleinias.org
I am trying to use lyxpak and it fails due to python-related issues. This
happens both in lyx2.1 and 2.0. I think it maybe a platform-specific issue
(Arch) due to some environmental variables not set by default, or to some
python2/python3 conflict. At any rate, I can't figure out how to fix it.
Here is the error message:
12:56:57.302: Fatal Python error: Py_Initialize: Unable to get the locale
encoding
12:56:57.303: File "/usr/lib/python2.7/encodings/__init__.py", line 123
12:56:57.304: raise CodecRegistryError,\
12:56:57.305: ^
12:56:57.306: SyntaxError: invalid syntax
which is puzzling, since it seems to say that there is a problem with the
syntax of the raise statement. Source code of the encodings file:
if not isinstance(entry, codecs.CodecInfo):
if not 4 <= len(entry) <= 7:
raise CodecRegistryError,\
'module "%s" (%s) failed to register' % \
(mod.__name__, mod.__file__)
As far as I can tell, the syntax of raise used here is indeed wrong if used
in python 3 (where raise Exception("excp") should be used). But why is
python 3 called at all, when lyxpak is correctly called as
/usr/bin/python2 -tt "/usr/local/share/lyx-2.1/scripts/lyxpak.py" ?
Secondly, the fact that the encodings module tries to raise an exception
means it has failed to find the correct module, I think.
So the two problems are most likely just one problem, due to some
interaction between python2 and python 3 on my system.
Any suggestion?
Cheers,
Stefano
--
__________________________________________________
Stefano Franchi
Associate Research Professor
Department of Hispanic Studies Ph: +1 (979) 845-2125
Texas A&M University Fax: +1 (979) 845-6421
College Station, Texas, USA
***@tamu.edu
http://stefano.cleinias.org