I've recently been encountering a LyX error in a Windows installation that worked previously without a hitch. I've tried reinstalling LyX and MiKTeX, to no avail. When I open LyX, no document classes are available. When I attempt to reconfigure LyX, I get an error message:
The system reconfiguration has failed. Default textclass is used but LyX may not be able to work properly. Please reconfigure again if needed.
The error log shows the following:
16:37:25.964: Running configure...
16:37:25.989: python -tt "C:/Program Files (x86)/LyX 2.1/Resources/configure.py" --binary-dir="C:/Program Files (x86)/LyX 2.1/bin/"
16:37:26.060: checking for DVI to DTL converter...
16:37:26.062: +checking for "dv2dt"... yes
16:37:26.063: checking for DTL to DVI converter...
16:37:26.065: +checking for "dt2dv"... yes
16:37:26.066: checking for a Latex2e program...
16:37:26.067: +checking for "latex"... yes
16:37:26.068: checking for a DVI postprocessing program...
16:37:26.069: +checking for "pplatex"... yes
16:37:26.071: checking for pLaTeX, the Japanese LaTeX...
16:37:26.072: +checking for "platex"... yes
16:37:26.073: Traceback (most recent call last):
16:37:26.074: File "C:/Program Files (x86)/LyX 2.1/Resources/configure.py", line 1536, in <module>
16:37:26.076: LATEX = checkLatex(dtl_tools)
16:37:26.077: File "C:/Program Files (x86)/LyX 2.1/Resources/configure.py", line 480, in checkLatex
16:37:26.078: if cmdOutput(PLATEX + ' chklatex.ltx').find('pLaTeX2e') != -1:
16:37:26.080: File "C:/Program Files (x86)/LyX 2.1/Resources/configure.py", line 68, in cmdOutput
16:37:26.081: cmd = 'cmd /d /c pushd ' + shortPath(os.getcwdu()) + '&' + cmd
16:37:26.082: File "C:/Program Files (x86)/LyX 2.1/Resources/configure.py", line 84, in shortPath
16:37:26.084: from ctypes import windll, create_unicode_buffer
16:37:26.085: File "C:\Anaconda\Lib\ctypes\__init__.py", line 10, in <module>
16:37:26.086: from _ctypes import Union, Structure, Array
16:37:26.087: ImportError: DLL load failed: %1 is not a valid Win32 application.
16:37:26.089: Reloading configuration.....\..\..\src\support\Systemcall.cpp (292): Systemcall: 'python -tt "C:/Program Files (x86)/LyX 2.1/Resources/configure.py" --binary-dir="C:/Program Files (x86)/LyX 2.1/bin/"' finished with exit code 1
16:39:00.090: (reconfigure)
The error seems to occur following python -tt "C:/Program Files (x86)/LyX 2.1/Resources/configure.py" --binary-dir="C:/Program Files (x86)/LyX 2.1/bin/"
. When I run the command via cmd
, it executes without any errors. What else should I attempt?
If you are able to run the script, you can just
cd
to your LyX user directory (on Linux this is~/.lyx
. For Windows, see Help > About) and run the configure command inside that directory. Do that without LyX running. Then open LyX. It should work just fine now.So to be clear, do not run reconfigure within LyX (as this does not appear to be working). As for why that problem occurs, we've gotten a few similar reports from Windows users. A wild guess is that LyX needs to run python 2.x and somehow 3.x is running. Another guess is that some PATH escapes aren't working through the GUI (e.g. the parentheses or the space).
Note, however that I've only used LyX on Ubuntu so these really are wild guesses.