2

I am using VSCode -installed from the .deb provided by microsoft- on Linux Mint 22 and texlive -installed with the official guide-. Previously I was a loyal user of miktex and that worked fine (most times), but there's been no release for Mint 22. So off to Tex Live I go. and now I'm using with the Latex Workshop extension, and I run for the first time into the ENOENT issue.

After digging around configurations, and looking at other questions here, I find a number of solutions which seemed odd to me but apparently worked for other people: using chown to change the ownership of the texlive folder to the local user, chmod to change privileges and even just restarting VSCode. I didn't try the second one because I checked the files and it all seemed fine to me; meanwhile, the first 2 didn't change anything.

I have texlive on $PATH. I can call which pdflatex, which latexmk... it gives me the answers I expect:

$ echo $PATH /home/*/.pyenv/shims:/home/*/.pyenv/bin:/usr/local/texlive/2025/bin/x86_64-linux:/home/*/.cargo/bin:/home/*/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin 
$ which latexmk /usr/local/texlive/2025/bin/x86_64-linux/latexmk 

Finally I check the workshop log and find the $PATH it calls to is defined differently:

Does the executable exist? $PATH: /home/*/.cargo/bin:/home/*/.pyenv/shims:/home/*/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin, $Path: undefined, $SHELL: /bin/bash 

For whatever reason, this variable is different to the one printed at terminal!

I also don't remember what method I used to add texlive to the variable, since the line export PATH =/usr/local/texlive/2025/bin/x86_64-linux:$PATH appears commented in my bashrc file. And uncommenting makes a not a valid identifier error appear on the terminal.

Now, I'm pretty certain that it used to work a while ago (I'm not sure because I use several devices), but I hadn't used latex in a few weeks; the one notable change I had in this system since the last time I recall using it was swapping the DE from Cinnamon to Plasma.

Update1: I found that I had added texlive to the path globally, at /etc/bash.bashrc and that let me also realize that I had a syntax error on the local .bashrc... now the texlive path does appear at the very beginning of the variable on echo... but it's still not the $PATH that Latex Workshop finds.

Update2: As per their documentation I've tried adding a path.sh with the command to $HOME/.config/plasma-workspace/env/path. Then I followed cfr's comment and did the same to /etc/profiles.d. Neither of them solved the issue.

8
  • 2
    Not everything uses bash. Might be an idea to add the PATH to your .profile file, then log out and in again (it is only executed at login). Then processes that does not execute bash should also be alve to see the proper PATH setting Commented Jul 31 at 6:24
  • @daleif It would be rather odd. But I did as you say anyway. Didn't help, but made me realize the mistake I was making with my bashrc file... though fixing that still didn't let Workshop find the correct path either. Commented Jul 31 at 15:43
  • it is not odd. ~/.bashrc is read by bash shells. I doubt vscode starts bash. on my system, I have a snippet under /etc/profile.d/ which sets this for all users, but mint may have a different setup. you need to ensure the path is set correctly for gui apps and not just for interactive shells (and certainly not only for bash shells). Commented Jul 31 at 16:47
  • correction: ~/.bashrc is read by non-login interactive bash shells. ~/.bash_profile, which should generally source it, is read by login interactive bash shells. if you start the gui from a bash shell, rather than using a display manager, the variable should be exported to the environment. but if you use a display manager or have a different shell as default, neither ~/.bashrc/~/.bash_profile nor /etc/bashrc will be read. Commented Jul 31 at 16:53
  • I'm saying it's odd because what i've done is what has always worked before and what seems to work for other people. And because pyenv does appear in the $PATH read by workshop.But I'm looking at the KDE docs and it turns out that it read the variable differently, so I'm gonna try that. Commented Jul 31 at 17:53

1 Answer 1

0

I found the issue in the .bashrc and .profile files. Since both files ended with:

export PYENV_ROOT="$HOME/.pyenv" [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init - bash)" . "$HOME/.cargo/env" export PATH="/usr/local/texlive/2025/bin/x86_64-linux:$PATH" 

I don't even remember installing rust... But moving the texlive command to the top of this list in both files made VSCode finally recognize it. I still don't know why adding it to /etc/profile.d and /etc/bash.bashrc or the plasma folder didn't help.

1
  • In Linux Debian a good place to place the path is /etc/environment. Commented Aug 16 at 20:57

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.