Use different texlive installation

Zelphir Kaltstahl zelphirkaltstahl at posteo.de
Fri Mar 27 01:05:56 UTC 2020


On 3/26/20 11:09 AM, Kornel Benko wrote:
> Am Thu, 26 Mar 2020 09:58:54 +0100
> schrieb Zelphir Kaltstahl <zelphirkaltstahl at posteo.de>:
>
>> On 25.03.20 22:35, lyx-users-request at lists.lyx.org wrote:
>>> Am Wed, 25 Mar 2020 21:49:45 +0100
>>> schrieb Zelphir Kaltstahl <zelphirkaltstahl at posteo.de>:
>>>  
>>>> Hello LyX users!
>>>>
>>>> I've searched the mailing list archives and found some instructions on
>>>> how to change the texlive installation, which LyX uses and added the
>>>> following to my `.profile`:
>>>>
>>>> ~~~~START~~~~
>>>> ###################
>>>> # texlive manager #
>>>> ###################
>>>> export MY_TEXLIVE_LOCATION="/usr/local/texlive"
>>>> export PATH="${MY_TEXLIVE_LOCATION}/2019/bin/x86_64-linux:${PATH}"
>>>>
>>>> #######
>>>> # LYX #
>>>> #######
>>>>
>>>> # LYX must know where texlive is installed, otherwise it will have limited
>>>> functionality. # prepend web2c path
>>>> export TEXMFCNF="${MY_TEXLIVE_LOCATION}/2019/texmf-dist/web2c" # ":${TEXMFCNF}"
>>>> # export MANPATH="${MY_TEXLIVE_LOCATION}/2019/texmf-dist/doc/man:${MANPATH}"
>>>> # export INFOPATH="${MY_TEXLIVE_LOCATION}/2019/texmf-dist/doc/info:${INFOPATH}"
>>>> ~~~~~END~~~~~
>>>>
>>>> And it worked great for a day, I got lots of writing done. Then the next
>>>> day I restarted my machine and LyX complained about not finding any
>>>> textclasses and that it would have limitations.
>>>>
>>>> Whenever I hit Tools > Reconfigure, I get an error on command line output:
>>>>
>>>> ~~~~START~~~~
>>>> +checking list of textclasses... 
>>>> Traceback (most recent call last):
>>>>   File
>>>> "/gnu/store/an9kb3hqk8368b05g39fz4bzrz18khp7-lyx-2.3.3/lyx2.3/share/lyx2.3/configure.py",
>>>> line 1897, in <module> ret = checkLatexConfig(lyx_check_config and LATEX != '',
>>>> bool_docbook) File
>>>> "/gnu/store/an9kb3hqk8368b05g39fz4bzrz18khp7-lyx-2.3.3/lyx2.3/share/lyx2.3/configure.py",
>>>> line 1380, in checkLatexConfig retval = processLayoutFile(file, bool_docbook) File
>>>> "/gnu/store/an9kb3hqk8368b05g39fz4bzrz18khp7-lyx-2.3.3/lyx2.3/share/lyx2.3/configure.py",
>>>> line 1327, in processLayoutFile classdeclaration = (b'"%s" "%s" "%s" "%s" "%s"'
>>>> TypeError: %b requires a bytes-like object, or an object that implements __bytes__,
>>>> not 'str' support/Systemcall.cpp (276): Systemcall: '/usr/local/bin/python -tt
>>>> "/gnu/store/an9kb3hqk8368b05g39fz4bzrz18khp7-lyx-2.3.3/lyx2.3/share/lyx2.3/configure.py"
>>>> --with-version-suffix=2.3 --binary-dir="/home/xiaolong/.guix-profile/bin/"' finished
>>>> with exit code 1 ~~~~~END~~~~~
>>>>
>>>> It seems like an implementation bug in the script, expecting another
>>>> type. I think it could also be Python 2 str VS Python 3 str related.
>>>>
>>>> When I go to Tools > TeX Information, the paths all point to my Guix
>>>> profile, instead of the path I defined in the TEXMFCNF environment
>>>> variable in my `.profile`. I think that is the reason, why it cannot
>>>> find much there. I did not install texlive using Guix, but installed it
>>>> by downloading it and installing every single package of the 2019
>>>> version using the default installer, which I think in turn uses tlmgr.
>>>>
>>>> My PATH variable starts as follows:
>>>>
>>>> ~~~~START~~~~
>>>> /home/xiaolong/.nvm/versions/node/v13.9.0/bin:/usr/local/texlive/2019/bin/x86_64-linux: ...
>>>> ~~~~~END~~~~~
>>>>
>>>> So it is definitely on the path. According to
>>>> https://tex.stackexchange.com/questions/454513/how-to-specify-the-path-to-texlive-in-lyx/454523#454523
>>>> that should be sufficient, but obviously it is not. It also does not ask
>>>> me after a while to restart it or anything, after rescanning in Tools >
>>>> TeX Information.
>>>>
>>>> Here is some more system information:
>>>>
>>>> ~~~~START~~~~
>>>> xiaolong at xlx200:~$ lsb_release -a
>>>> No LSB modules are available.
>>>> Distributor ID:	Trisquel
>>>> Description:	Trisquel GNU/Linux 8.0, Flidas
>>>> Release:	8.0
>>>> Codename:	flidas
>>>>
>>>> xiaolong at xlx200:~$ which lyx2.3 
>>>> /home/xiaolong/.guix-profile/bin/lyx2.3
>>>>
>>>> xiaolong at xlx200:~$ which python
>>>> /usr/local/bin/python
>>>>
>>>> xiaolong at xlx200:~$ which tlmgr
>>>> /usr/local/texlive/2019/bin/x86_64-linux/tlmgr
>>>>
>>>> xiaolong at xlx200:~$ which latexmk
>>>> /usr/local/texlive/2019/bin/x86_64-linux/latexmk
>>>> ~~~~~END~~~~~
>>>>
>>>> Here is a complete log of the output on command line, when I run
>>>> `lyx2.3` (it even says, that it will use a wrong texlive):
>>>>
>>>> https://paste.debian.net/1136648/
>>>>
>>>> So at some point my LyX did look at the correct path, but not it is not
>>>> and I need to fix it.
>>>>
>>>> What can I do to make LyX pick up the correct texlive installation path?
>>>>
>>>> Best regards,
>>>> Zelphir  
>>> Probably you have to tell Guix about the new path.
>>> Have you tried to start lyx from the terminal? (That is, after the .profile is loaded)
>>>
>>> 	Kornel  
>> Hello Kornel!
>>
>> How do I tell Guix about the new path?
>>
>> I might be wrong, but as far as I understand LyX installed through Guix
>> is just another binary sitting in a different place. How LyX considers
>> environment variables should be independent from how it is installed,
>> unless the people maintaining the Guix package changed it.
> The installed programs do not have any environments. It is your environment
> which will be used at program start. (Or that of Guix because it is what
> Guix got at its start, that is on your login)
>
>> I guess
>> people, who maintain the Guix package would also be on this mailing list
>> and might know more about any differences with regard to how LyX makes
>> use of environment variables.
> Sure, but the values from .profile are not active at the moment Guix starts (my guess).
> There may be another file (for instance .xinitrc) which may be evaluated before Guix
> starts.
>
>> I ran LyX from terminal to get the output in the paste I linked to. I
>> simply type `lyx2.3` and enter/return, then the LyX binary (compiled at
>> the installation with Guix) starts up and looks up stuff, whereupon it
>> somehow finds the wrong texlive path and does not use my complete
>> installation of texlive 2019 sitting at another path.
>>
>> Is there an environment variable I can set, besides TEXMFCNF, which
>> clearly tells LyX to look elsewhere?
>>
>> Regards,
>> Zelphir
>>
> Hello Zelphir,
> I had a similar problem with other window managers, because of not using .profile.
> (I use tcsh as a shell)
> I don't know Guix, but it may be the same solution would work for you too.
> 1.) Edit (or create) ~/.pam_environment (Attached the content of my file)
> 2.) You need also some packages libpam-runtime libpam0g libpam-modules libpam-modules-bin
> libpam-systemd
>   (You probably have them already)
> It should work with the next login.
>
> 	Kornel


Hi Kornel!

You were right! I found an even easier solution though:

My ~/.profile definitions are not visible to a program installed via
Guix, when it starts. So I looked around in my Guix profile folder at
~/.guix-profile and found an etc/profile in there. There I add my
variables, just like in ~/.profile and tada! LyX starts just fine. I
guess, that LyX only worked the first time correctly, because the Guix
daemon was already started and did not read the default definitions in
that ~/.guix-profile/etc/profile without rebooting or relogin. So when I
started my machine the next day, it suddenly started seeing those wrong
default variable values in there. Now that I changed them in there,
after a relogin everything works as expected. No more errors on command
line output.

Not sure whether that profile file will be overwritten in the future,
but if that happens I will notice and search for a Guix best practice
regarding environment variables.

Thank you for your help and hints!

Regards,
Zelphir



More information about the lyx-users mailing list