[Tex/LaTex] Installing LyX: “No textclass is found.”

lyx

About installing LyX!

This is my old post.


I have been trying to install LyX, but the same error message pops out when I excute LyX.exe as follows:

LyX: No textclass is found

LyX will only have minimal functionality because no textclasses have been found. You can either try to reconfigure LyX normally, try to reconfigure without checking your LaTeX installation, or continue.

(Press the button) Reconfigure (or) Without LaTeX (or) Continue


Before LyX, I used TeXLive as my tex distribution, and I'm using Windows 10.

Here's what I have done to fix the problem in a chronological order:

  1. I installed LyX, and it did not work. I followed the instructions given in the link https://www.youtube.com/watch?v=kALm051M0iA&t=179s

  2. I thought TeXLive was not okay as a tex program for LyX, so I installed MikTex 2.9.

  3. In the old post, a commenter corrected me to use only one tex distributions for LyX, and recommended me to delete all of the three programs, and do it again.

  4. I did it so, and I installed TeXLive(this is because I'm used to it) and LyX, and with the same error message.

  5. http://www.ktug.org/xe/index.php?mid=KTUG_open_board&document_srl=174234
    This link suggests to replace the "configure.py" file by new one attached in the link, and I did it, but the same result.

  6. As a commenter says, I emailed to lyx-users@lists.lyx.org to ask for advice, and one user answers very kindly, and the following are his suggestions and the corresponding results.

  7. I opened a Command Prompt (Start Menu -> cmd.exe) and type "where pdflatex." The result was

"C:\Users\장지웅\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\pdflatex.exe",

where the installation program of LyX chose as a path to latex.exe.

  1. I "reconfigured" LyX (Tools -> Reconfigure), then LyX says

The system reconfiguration has failed. Default textclass is used but LyX may not be able to work properly. Please reconfigure again if needed.

I still have the message after I restart LyX.

  1. Now, I tried the suggestions in the link:

LyX installation error- text class not found- 'Reconfigure' or 'use without latex' option coming

8.1) opened a command prompt in windows with administrative privileges.

8.2) navigated to the directory containing lyx.exe 'c:\program files (x86)\lyx 2.1\bin' on my machine.

8.3) executed lyx.exe

8.4) everything involving python calls failed – reconfigure (which uses configure.py), opening old documents (which uses lyx2lyx), etc.

8.5) exited lyx back to the command prompt

8.6) on the command line typed 'set pythonpath=' which clears the pythonpath.

8.7) on the command line typed 'set path=' which clears the path.

8.8) typed lyx.exe to reenter lyx

8.9) but the result was the same, sad.

  1. Now, second try: https://wiki.lyx.org/LyX/Troubleshooting

9.1)Uninstall LyX from your PC if you have used an installation folder whose name exists of seperate words like C:\Program Files.

9.2)Reinstall LyX and consider, that you use a folder whose name exists of just one word like C:\Lyx15

9.3)Start the Command Prompt in windows (Start -> All Programs -> Accessories -> Command Prompt)

9.4)Change directory to C:\ (type c:)

9.5)Type "c:/lyx15/python/python.exe c:/lyx15/resources/configure.py" in the Command Prompt and press "return"

9.6)After the configuration has been finished you will find 4 files in the directory c:\ -> configure.log, lyxrc.defaults, textclass.lst and packages.lst. The browser could find the first two files, but not the latter two files. I kept going. (Maybe problems with lst format?)

9.7)Cut these 4 files and paste them into the \Username\Application Data\LyX folder. If a directory for Lyx does not exist create a new one.

9.8)Start Lyx.

But, to no avail.

10) I again deleted TeXLive, Lyx, and installed MikTex2.9, LyX.
I did the above, but no improvement.

11) One comment in the old post suggests to the following:

Since you changed configuration to MiKTeX it may help to go back to basics. LyX looks for TeX at start-up & should reconfigure itself to suit so important we know how well set MiKTeX is. From any point on your system get cmd prompt type in> pdfLaTeX –version you should get a response of numbers confirming that LyX can do similar. If that step says like not an operable command then LyX wont know how to proceed. Also enter> Where /r \ pdfLaTeX which should confirm how many copies may be conflicting (check that it matches> Where $path:pdflatex ) the two should agree on one single copy.

12) Now, any suggestions would be appreciated. I came to the point that I don't understand why I'm doing it so hard.


Updates.

I reinstalled Miktex and LyX in the C file to rule out any Korean characters and spaces in their addresses.

Here is the result:

enter image description here

The first two lines show that the two commands "where /r \ pdflatex" and "where $path:latex" give different results. The Korean in the second answer is:

정보: 제공된 패턴에 해당되는 파일을 찾지 못했습니다

==Information: no files corresponding to the given pattern is found.

Second, I typed "c:\lyx2.3\python\python.exe c:\lyx2.3\resources\configure.py," but the error "Remission denied: c:\configure.log," and there was no textclass in the last line.

I focused on any involvement in Korean characters and spaces, and did the same tests, I am not sure I've done right as the answer guides.


Updates.

The two "where" matches:

C:\Users\장지웅>where /r \ pdflatex

C:\MiKTeX2.9\miktex\bin\pdflatex.exe

C:\Users\장지웅>where $path:pdflatex

C:\MiKTeX2.9\miktex\bin\pdflatex.exe.

Being aware of the changed directory name "LyX2.3," I did the action "c:\lyx15\python\python.exe c:\lyx15\resources\configure.py" with lyx15 replaced by lyx2.3. The result takes some time, which was new to me, but the two latter files of configure.log, lyxrc.defaults, textclass.lst and packages.lst are not found.


Updates.

Here's the path.

C:\Users\장지웅>PATH

PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Cuminas\Document Express DjVu Plug-in\;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\Programs\Matlab\bin;C:\Lyx2.3\Perl\bin;C:\Users\장지웅\AppData\Local\Microsoft\WindowsApps;C:\Users\장지웅\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\;C:\Users\장지웅\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\;C:\MiKTeX2.9\miktex\bin\


Updates.

Progress! Now no message that no textclass is found.

What I did first is to cut and paste textclass.lst and other files (from the past installation, I think) in the folder here and there. For example,

C:\Users\장지웅\AppData\Roaming
C:\Lyx2.3\Resources
C:\Windows\Application Data
C:\Users\장지웅\AppData\Roaming

(장지웅 is my name.)

Then the shortcut in Desktop opens with no error message, the View (ctrl+R) button was not available, even though I opened newfile.

enter image description here

Second, I followed the instruction:

Traditionally it was easy to modify the start up icon however with windows 10 it is a bit more convoluted. So in the start menu find Lyx right click the LyX icon follow More to Open File Location which should take you to the user folder ….\Microsoft\Windows\Start Menu\Programs\LyX 2.3 now again right click the small LyX icon and select properties and you should see "Target" box has C:\LyX2.3\bin\LyX.exe this is where you need to paste the amended command e.g. C:\Lyx2.3\Lyx.exe -userdir C:\Lyx2.3\UserDir

There was a change. When I tried to open a newfile, the following message came up;

enter image description here

Then, I could press the View button, but LyX said

enter image description here

and in turn

enter image description here

After this message poped up, the Lyx ended automatically.

Third, I opened a new notepad and typed "C:\LyX2.3\UserDir" and saved it as startLyX.cmd on the desktop.

Fourth, I created a Temp folder at C:\Lyx2.3, and set the temporary directory as suggested, I could not see any change.

Thanks,

Best Answer

After testing the possibilities of adjusting LyX's behaviour using a "portable" approach as given in the other answer, in this case the solution was to simply add a fresh username composed of simple characters.

NOTE a number of users may arrive here who have either accented names or be composed UTF-8 characters or simply have a two-part name with a space. In such cases it is best to consider adding a new user to the system with a single plain ascii moniker.

e.g. c:\users\me\

IF you have already installed TeX and LyX you have likely encountered the issue of LyX complaining it cant find the TeX classes. So as a minimum uninstall LyX for that problem account.

Now using the new account BEFORE you do a fresh LyX install, first check that your TeX is correctly configured. On windows you need to confirm that the two following commands agree EXACTLY.

So to test all is well check that there is only one pdfLaTeX and that it is included in the path variable so from a command prompt run

>  where /r \ pdfLaTeX
>  where $path:pdflatex

both should agree it will of course vary for each user HOWEVER it should be one IDENTICAL entry for both commands

e.g. c:\ ..tex.. \ .. \some\bin\pdflatex.exe

Using the fresh account next check if installing LyX clears the problem. If you still encounter issues with the underlying TeX (MiKTeX or Tex Live) then you may need to consider re-installing one of those again. But again ensure you pass the where test before starting the new LyX.

When you make significant changes to the underlying programs especially MiKTeX updates, you may need to frequently use the "Reconfigure" option within LyX.

An associated problem can be the choice of PDF viewer since LyX uses background processes such as DDE or Pipes to control the pdf viewing. You may wish to check out alternatives.

Related Question