FS#59600 - [lyx] Reconfigure should use Python 2, not Python 3
Attached to Project:
Arch Linux
Opened by Moabit (Moabit) - Friday, 10 August 2018, 09:52 GMT
Last edited by freswa (frederik) - Sunday, 13 September 2020, 10:09 GMT
Opened by Moabit (Moabit) - Friday, 10 August 2018, 09:52 GMT
Last edited by freswa (frederik) - Sunday, 13 September 2020, 10:09 GMT
|
Details
Description:
Attempting to reconfigure LyX fails with the following on the command line: ``` LyX: reconfiguring user directory File "/usr/share/lyx/configure.py", line 60 def cmdOutput(cmd, async = False): ^ SyntaxError: invalid syntax Systemcall.cpp (294): Systemcall: 'python -tt "/usr/share/lyx/configure.py" --binary-dir="/usr/bin/"' finished with exit code 1 LyX: Done! ``` This is because Arch uses Python 3 by default, while LyX expects Python 2. A workaround is to reconfigure on the command line, calling Python 2 specifically. i.e. ``` $ cd ~/.lyx $ python2 /usr/share/lyx/configure.py ``` Additional info: * package version(s): 2.3.0-1 Steps to reproduce: Select menu: `Tools` > `Reconfigure` |
This task depends upon
# DISPLAY=:0 lyx reconfigure
Without python installed, but with python2 installed:
LyX: Creating directory /root/.lyx/
Looking for python v2.x or 3.x ...
Examining /usr/bin/python2
Found Python 2.7.15
LyX: reconfiguring user directory
checking for a Latex2e program...
With both installed:
LyX: Creating directory /root/.lyx/
LyX: reconfiguring user directory
File "/usr/share/lyx/configure.py", line 60
def cmdOutput(cmd, async = False):
^
SyntaxError: invalid syntax
Systemcall.cpp (294): Systemcall: 'python -tt "/usr/share/lyx/configure.py" --binary-dir="/usr/bin/"' finished with exit code 1
LyX: Done!
...
That's just every type of backwards, it checks for python first then falls back on python2? They explicitly list the requirements as: "Python: Required for configuration and conversion scripts. Tested with version 2.7. Python 3.0 is work in progress."
So why are they set up to prefer the latter?
$ lyx
checking LaTeX configuration... default values
+checking list of textclasses...
Traceback (most recent call last):
File "/usr/share/lyx/configure.py", line 1904, in <module>
ret = checkLatexConfig(lyx_check_config and LATEX != '', bool_docbook)
File "/usr/share/lyx/configure.py", line 1384, in checkLatexConfig
retval = processLayoutFile(file, bool_docbook)
File "/usr/share/lyx/configure.py", line 1332, in processLayoutFile
% (classname, opt, desc, avai, prereq))
TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str'
Systemcall.cpp (276): Systemcall: 'python -tt "/usr/share/lyx/configure.py" --binary-dir="/usr/bin/"' finished with exit code 1
LyX: Done!
LayoutFile.cpp (172): LayoutFileList::Read: no textclasses found!