quarto-dev / quarto

Quarto open-source scientific and technical publishing system
https://quarto.org
GNU Affero General Public License v3.0
332 stars 29 forks source link

Conda install of Quarto does not find the correct system wide tlmgr #223

Open fenke opened 1 year ago

fenke commented 1 year ago

I am getting an error when rendering pdf

running xelatex - 1 command xelatex not found, attempting install finding package for xelatex ERROR: Error executing '/home/fenke/miniconda3/envs/numdev/bin/tlmgr': No such file or directory (os error 2)

XeLatex is installed:

(numdev) me@host:~/repos/wodan> xelatex This is XeTeX, Version 3.141592653-2.6-0.999993 (TeX Live 2021/TeX Live for SUSE Linux) (preloaded format=xelatex) restricted \write18 enabled. ** ! End of file on the terminal... why?

This, imo, should not happen, first of all, quarto shouldn't be poking around in texlive's installation and secondly, it's looking in the wrong place, TeXLive is a system managed package, Quarto is managed by conda. Something assumes texlive's tlmgr location is near where quarto lives - which is probably why it couldn't find XeLatex it in the first place.

Update:

Until recently I used Quarto with the VSCode extension - no problem. This started after installing Quarto in a Conda environment for the use of NBDev. Since then, the VSCode extension fails, I assume it's running the conda version and looking (in the wrong place).

cderv commented 1 year ago

This type of error happens when tlmgr is not found on the system by Quarto. It seems Quarto does not find your default LaTeX installation. So something is off regarding the path to find LaTeX.

FWIW Quarto will run tlmgr as found on PATH, in the environment context of where quarto render is run. I don't know if your numdev environment contains a tlmgr binary somewhere. I suppose which xelatex does not return a path inside numdev miniconda environment ?

Does Quarto at command line is working ? without the VSCODE extension I mean. Just to help scope the issue here.

fenke commented 1 year ago

numdev (conda) does not have LaTeX installed, LaTeX (TeXLive) is a system install. quarto was part of the numdev environment. it was looking for tlmgr (and presumable XeTeX) within the numdev conda environment, where is was not installed.

When not installing within conda, but only in ~/opt and linked in ~/bin (which is done by the VSCode extension) it works just fine.

In the end it looks ok (I still have to test with nbdev) when not using conda, but some users might prefer a conda install over a system or user install

thank you for your time - and a fantastic application.

cderv commented 1 year ago

In the end it looks ok (I still have to test with nbdev) when not using conda, but some users might prefer a conda install over a system or user install

I agree. Does quarto was install part of numdev by nbdev ? I see it offers installing Quarto (https://nbdev.fast.ai/api/quarto.html#install_quarto). Or was it through conda install directly ?

Does Quarto at command line is working ? without the VSCODE extension I mean. Just to help scope the issue here.

Still interested by this with your conda installation. Does it work outside of VSCODE ? It would help to know if this is a Quarto extension for VSCODE issue or not.

fenke commented 1 year ago

Don't know what happened but after hours quarto is completely broken now. thanks

I tried to remove it from conda environments and add it to others and now it won't work at all, even VSCode can't find it. This sucks. What are you doing with your installation scripts? What is conda fucking around with paths?

cderv commented 1 year ago

Sorry you got in this state. How are you installing Quarto exactly ? You did not answer the question I asked in previous post.

Can you help me try to reproduce your step and look into what can happen.

fenke commented 1 year ago

Ok, it's ok, I got quarto back running in the default bash terminal. Basically did a manual install with the latest tar.gz into ~/opt and a symlink in ~/bin pointing to the quarto executable in ~/opt/quarto-1.3.433/bin/quarto VSCode is happy again, CLI is happy, I am happy

nbdev did not install quarto. Their manual mentions giving passwords and installing it systemwide and I'll be damned if I let them mess around with that. That remark is actually the reason I started with the conda-forge version of quarto - as I assumed VSCode would be using a private installation of quarto - I think it installs for the user in ~/opt

So, I installed quarto through conda in an environment for it, then used a venv for jupyter and nbdev - since nbdev likes a jupyter extension that is only available through pip (and mixing pip on conda was not recommended). That worked fine with the html rendering, but pdf rendering gave the error.

For me the practical conclusion is to not install the conda version of quarto which appears to be looking for XeTeX within the same environment.

To reproduce I think:

install systemwide TeXLive create conda environment, add quarto quarto render --to pdf

(test-quarto) fenke@denkdoosje:~/repos/wodan> quarto render sapflow.qmd --to pdf

Starting python3 kernel...Done

Executing 'sapflow.ipynb' Cell 1/14...Done Cell 2/14...Done Cell 3/14...Done Cell 4/14...Done Cell 5/14...Done Cell 6/14...Done Cell 7/14...Done Cell 8/14...Done Cell 9/14...Done Cell 10/14...Done Cell 11/14...Done Cell 12/14...Done Cell 13/14...Done Cell 14/14...Done

pandoc to: latex output-file: sapflow.tex standalone: true pdf-engine: xelatex variables: graphics: true tables: true default-image-extension: pdf toc: true number-sections: true

metadata documentclass: scrartcl classoption:

running xelatex - 1 command xelatex not found, attempting install finding package for xelatex ERROR: Error executing '/home/fenke/miniconda3/envs/test-quarto/bin/tlmgr': No such file or directory (os error 2)

Error: Error executing '/home/fenke/miniconda3/envs/test-quarto/bin/tlmgr': No such file or directory (os error 2) at execProcess (file:///home/fenke/miniconda3/envs/test-quarto/bin/quarto.js:5630:15) at execTlmgr (file:///home/fenke/miniconda3/envs/test-quarto/bin/quarto.js:85279:16) at tlmgrCommand (file:///home/fenke/miniconda3/envs/test-quarto/bin/quarto.js:85293:16) at findPackages (file:///home/fenke/miniconda3/envs/test-quarto/bin/quarto.js:85137:35) at Object.searchPackages (file:///home/fenke/miniconda3/envs/test-quarto/bin/quarto.js:85500:20) at runLatexCommand (file:///home/fenke/miniconda3/envs/test-quarto/bin/quarto.js:85458:60) at async runPdfEngine (file:///home/fenke/miniconda3/envs/test-quarto/bin/quarto.js:85364:21) at async initialCompileLatex (file:///home/fenke/miniconda3/envs/test-quarto/bin/quarto.js:85798:26) at async generatePdf (file:///home/fenke/miniconda3/envs/test-quarto/bin/quarto.js:85772:22) at async Object.complete (file:///home/fenke/miniconda3/envs/test-quarto/bin/quarto.js:86044:27) (test-quarto) fenke@denkdoosje:~/repos/wodan>

cderv commented 1 year ago

Thanks a lot for the detailed explanation, I'll look into this conda install and TeX Live issue.