0

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,

  • Does it now work? – Andrew Swann Apr 7 at 13:43
  • @AndrewSwann Nope... – JJW Apr 7 at 14:00
  • OK that last part shows latex is ok (however it is on a path with Korean ? characters that is most likely part of the issue) so we need to get lyx to see it using the troubleshooting suggestion again run (with back slashes as I have here c:\lyx15\python\python.exe c:\lyx15\resources\configure.py (this may again be part of the issue since \ gets converted) it should take several minutes streaming the locations it finds and if you don't get the 4 files it failed so we may need to consider a fresh approach – user170109 Apr 7 at 14:12
  • @KJO I reposted the result as a new answer(is there any appropriate way to reply to your answer, not as a comment?). Hmm... no progress. Please take a look. – JJW Apr 8 at 10:48
  • @KJO I added the new result. – JJW Apr 8 at 12:01
0

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.

0

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:\texlive\2019 (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.. \ .. \some\bin\pdflatex.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##\python\python.exe drive:\lyx##\resources\configure.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.3\bin\Lyx.exe -userdir C:\Lyx2.3\UserDir

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 ....\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\bin\Lyx.exe -userdir C:\Lyx2.3\UserDir

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

  • It would be better to add a comment here. I found the file textclass.lst and the other files. I guess by the time when the files were created that they are from the use of UserDir. They are now located at C:\Users\장지웅. – JJW Apr 9 at 16:30
  • In combination with my comment above we are now trying to avoid the c:\users area and tell lyx to work with the portable tex live in a "userdir" of its own making like in the example above thus you need lyx to confirm on its "help" "about lyx" "user directory =" entry that it is c:\Lyx.2.3\UserDir NOT as previous in ~appdata\ – user170109 Apr 9 at 16:47
  • Yes, I now see that "User directory: ~\AppData\Roaming\LyX2.3\" in the "help" "about lyx" is problematic. How can I change this to c:\Lyx.2.3\UserDir? – JJW Apr 9 at 16:56
  • I added the new result. I have questions. I wonder why the two "where" tests does not agree. Is it not important now? and where do I save the startLyX.cmd file? – JJW Apr 10 at 0:15
  • The desktop file should have 1 line with 3 parts C:\Lyx2.3\bin\Lyx.exe -userdir C:\Lyx2.3\UserDir and a double click will start LYX telling it to USE own USERDIR this is how we get LyX to NOT use your name. Unfortunate user directories such as "documents" "downloads" "pictures" on Win are accessed via username – user170109 Apr 10 at 1:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.