gpoore / minted

minted is a LaTeX package that provides syntax highlighting using the Pygments library. Highlighted source code can be customized using fancyvrb.
1.74k stars 126 forks source link

Package minted Error: minted v3+ executable is not installed or is not added to `PATH`. #409

Closed Witiko closed 2 hours ago

Witiko commented 2 hours ago

Since the last week's build of the texlive/texlive Docker image, the minted package appears broken:

$ docker run --pull=always --rm -it texlive/texlive
# cat > mwe.tex
\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}{tex}
\foo
\end{minted}
\end{document}
# pdflatex -shell-escape mwe.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024) (preloaded format=pdflatex)
 \write18 enabled.

[... output omitted for brevity]

) (./_1A79A4D60DE6718E8E5B326E338AE533.config.minted)

! Package minted Error: minted v3+ executable is not installed or is not added 
to PATH.

See the minted package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.6 \end{minted}

? 

This prevents today's planned release of witiko/markdown, since we can't build documentation. Any suggestions as to what the issue/solution could be, beyond what the error text says, and a hotfix/ETA for a fix?

Witiko commented 2 hours ago

Closed as a duplicate of https://github.com/gpoore/minted/issues/401. Sorry about that!

gpoore commented 1 hour ago

I believe #401 was primarily due to an issue with the initial CTAN packaging of minted v3.0. Everything should be working now. Does your Docker image include absolutely all recent TeX Live updates? If not, that could be the issue.

The only remaining part of #401 that I am aware of is the potential for errors during the first compile due to temp files. These automatically fix themselves on subsequent compiles once minted switched out of first-compile-optimization mode. That can currently be addressed by using \usepackage[highlightmode=immediate]{minted}, but I will be releasing a new version within the next day or so that automatically detects most temp files and prevents that error, while still working with first-compile-optimization mode.

Witiko commented 36 minutes ago

I believe #401 was primarily due to an issue with the initial CTAN packaging of minted v3.0. Everything should be working now. Does your Docker image include absolutely all recent TeX Live updates? If not, that could be the issue.

It definitely includes the released version from 2024-09-22 that is listed on CTAN. Running tlmgr update --self minted has no effect. The environmental variable PATH should also be set correctly but just to rule it out, I also manually ran tlmgr path add, also to no effect. My CI runs weekly and this is the first time the issue has appeared, so it seems related to the 3.0.0 release of minted. For now, I hotfixed it by using minted2.sty, as you suggested in https://github.com/gpoore/minted/issues/401#issuecomment-2371694853.

My example from https://github.com/gpoore/minted/issues/409#issue-2556453303 should be easy to reproduce if you have a Linux box with Docker installed.