Am Sonntag, 1. Juni 2014 um 13:37:37, schrieb stefano franchi <stefano.fran...@gmail.com> > On Sun, Jun 1, 2014 at 1:24 PM, stefano franchi <stefano.fran...@gmail.com> > wrote: > > > 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? > > > > > > > > > > Further info: > > - "python" defaults to python3 on my system > > - my python3 installation is broken, and indeed launching "python" from > the command line gives me exactly the same error as lyxpak.py > > > So the issue seems to be that lyxpak indirectly calls "python" at some > points, this calls ends up calling python3, which fails. > > I still do not understand where this misguided call to python3 comes into > the picture, though. >
You could try to trace it, like this on linux: # strace -f -o xx /usr/bin/python2 -tt "/usr/local/share/lyx-2.1/scripts/lyxpak.py" > S. Kornel
signature.asc
Description: This is a digitally signed message part.