TransWikia.com

Installing LyX: "No textclass is found."

TeX - LaTeX Asked by JJW on January 11, 2021

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 [email protected] 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장지웅AppDataLocalProgramsMiKTeX 2.9miktexbinpdflatex.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.1bin’ 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 UsernameApplication DataLyX 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.3pythonpython.exe c:lyx2.3resourcesconfigure.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.9miktexbinpdflatex.exe

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

C:MiKTeX2.9miktexbinpdflatex.exe.

Being aware of the changed directory name “LyX2.3,” I did the action “c:lyx15pythonpython.exe c:lyx15resourcesconfigure.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 FilesOracleJavajavapath;C:Program Files (x86)CuminasDocument Express DjVu Plug-in;C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;C:windowssystem32;C:windows;C:windowsSystem32Wbem;C:windowsSystem32WindowsPowerShellv1.0;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;D:ProgramsMatlabbin;C:Lyx2.3Perlbin;C:Users장지웅AppDataLocalMicrosoftWindowsApps;C:Users장지웅AppDataLocalProgramsMiKTeX 2.9miktexbinx64;C:Users장지웅AppDataLocalProgramsMiKTeX 2.9miktexbin;C:MiKTeX2.9miktexbin


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장지웅AppDataRoaming
C:Lyx2.3Resources
C:WindowsApplication Data
C:Users장지웅AppDataRoaming

(장지웅 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 ….MicrosoftWindowsStart MenuProgramsLyX 2.3 now again right click the small LyX icon and select properties and you should see “Target” box has C:LyX2.3binLyX.exe this is where you need to paste the amended command e.g. C:Lyx2.3Lyx.exe -userdir C:Lyx2.3UserDir

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.3UserDir” 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,

2 Answers

On this occasion This answer did not work for the OP (Original Post), I am leaving it here since It may help other users that have a similar problem with running a portable install on an affected system.

One of the problems with many interdependent programs is that when chained together it only needs one to have a problem with file paths including spaces or extended characters then many downstream applications can fail.

Many users find that LyX or more likely its dependency on Python, Perl, Synctex etc. Can lead to such issues.

In the following drive: can be any including the C: drive

The solution is to install portable LyX in its own folder such as drive:lyx2.3 (current version is 2.32-2) Equally if MiKTeX or Tex Live components are causing issues (use only one) it may help to use the Portable version and install to drive:miktex2.9 (current version is 2.9.7) or drive:texlive2019 (presuming it is released this month).

If you get the message from LyX : unable to find textclass file then the python component was unable to work correctly during install possibly as a result of a path naming issue.

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

>  where /r drive: 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.. .. somebinpdflatex.exe

We now have two options when running LyX and in some cases changing the UserDir may be the better one. see UserDir below.

The traditional fix i.e. to build the files that failed during installation run (replacing Lyx## with whatever you used for your install)

drive:lyx##pythonpython.exe drive:lyx##resourcesconfigure.py  

There should be lots of activity as it rebuild the long list of interdependent files it finds and at the end you may have as many as 13 new files in the folder you ran it. IMPORTANT one should be the textclass.lst we are needing to clear the error.

These files need to be placed in your user installation folder which by default will be hidden so the simplest way to find it is enter into an explorer address bar

 %appdata%  

and look for a folder such as LyX2.3 (the current default) this is where the 13 files need to be placed.

If that does not work for you then an alternative is to use

UserDir

When you start LyX you can specify a user directory other than the default one (which is hidden in user appdata). If using a batch file then you could use an alternative set=userdir variable but I am not adding it here as it varies over time, read the current customisation.pdf section Your local configuration directory for the current environment variable.

This may be useful when a user name has spaces or unexpected characters. So given that you have installed Lyx in a Directory such as c:Lyx2.3 you would need to change the startup shortcut to add a foldername so the command you use to start LyX becomes

C:Lyx2.3binLyx.exe -userdir C:Lyx2.3UserDir

On first run LyX should ask if you want it to build the directory and after some delay you will find the user configuration files have been added including textclass.lst. you can confirm the directory changed by looking at "help" "about"

enter image description here

The simplest way to start LyX with this parameter is to cut and paste the line above into a text file on the desktop then ensure you rename the file with a .cmd or .bat filename such as startLyX.cmd (ensure it is NOT.cmd.txt or else it will simply open in the editor instead of running LyX). Now you can double click that file so that it runs LyX with the extra directive.

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 ....MicrosoftWindowsStart MenuProgramsLyX 2.3 now again right click the small LyX icon and select properties and you should see "Target" box has C:LyX2.3binLyX.exe this is where you need to paste the amended command e.g. C:Lyx2.3binLyx.exe -userdir C:Lyx2.3UserDir

In order to ensure LyX is not using remote problematic directories for working it is desirable to also set its temporary directory to the same area so under preferences paths navigate to LyX main folder and add a new folder called Temp (or whatever but keep it simple latin characters) now LyX should not have any reason to use appdata folders.

enter image description here

 
 
Once LyX is happy to run then you need to CHECK TEX scan, reconfigure & restart

enter image description here

Answered by user170109 on January 11, 2021

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:usersme

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.. .. somebinpdflatex.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.

Answered by user170109 on January 11, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP