`minted` v3 and `latexminted` finds `kpsewhich` in an incorrect directory
- Dominant language
- Perl
- Stars
- 3.9k
- Forks
- 213
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
First, I really want to thank the author who made it possible to typeset LaTeX documents on iOS/iPadOS devices locally---this has completely transformed the way I use my iPad!
Using the latest `minted` package along with the `latexminted` (via `pip install latexminted`), it tries to find the `kpsewhich` binary in a directory `/private/var/mobil
e/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/texlive/2024/bin/arm-darw
in` which is absent:
```
[~/Documents/test]$ pdflatex -shell-escape main
This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024) (preloaded format=pdflatex)
\write18 enabled.
entering extended mode
(./main.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-05-08>
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/base/size10.clo))
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/minted/minted.sty
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/generic/catchfile/catchfile.sty
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/generic/infwarerr/infwarerr.sty)
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty)
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/generic/etexcmds/etexcmds.sty
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/generic/iftex/iftex.sty)))
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/fvextra/fvextra.sty
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/graphics/keyval.sty))
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/upquote/upquote.sty)
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/lineno/lineno.sty
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/kvoptions/kvoptions.sty
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty))))
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/latex2pydata/latex2pydata.sty
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty))
LaTeX Warning: You have requested, on input line 33, version
`2024/10/16' of package latex2pydata,
but only version
`2024/05/16 v0.2.0 latex2pydata - write data to file in Python l
iteral format'
is available.
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.t
ex
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/generic/pgf/utilities/pgfkeyslibrary
filtered.code.tex)))
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/pgfopts/pgfopts.sty)
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/tools/shellesc.sty)
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/float/float.sty))
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/xcolor/xcolor.sty
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/graphics-def/pdftex.def)
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/graphics/mathcolor.ltx))
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
)
No file main.aux.
(/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B
5067E7/Library/texlive/2024/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
)Traceback (most recent call last):
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/python3.11/site-packages/latexrestricted/_restricted_pathlib.py", line 641, in writable_file
return self._writable_file_cache[self.cache_key]
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: (, ResolvedRestrictedPath('/private/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/.latexminted_config'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/bin/latexminted", line 8, in
sys.exit(main())
^^^^^^
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/python3.11/site-packages/latexminted/cmdline.py", line 143, in main
from .command_clean import clean_messages, paths_skipped_in_initial_temp_cleaning
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/python3.11/site-packages/latexminted/command_clean.py", line 17, in
from .messages import Messages
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/python3.11/site-packages/latexminted/messages.py", line 16, in
from .restricted import MintedTempRestrictedPath
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/python3.11/site-packages/latexminted/restricted/__init__.py", line 13, in
from ._latexminted_config import latexminted_config
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/python3.11/site-packages/latexminted/restricted/_latexminted_config.py", line 220, in
latexminted_config = LatexMintedConfig()
^^^^^^^^^^^^^^^^^^^
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/python3.11/site-packages/latexminted/restricted/_latexminted_config.py", line 116, in __init__
self._load(LatexMintedConfigPath.home() / config_name)
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/python3.11/site-packages/latexminted/restricted/_latexminted_config.py", line 140, in _load
data_str = path.read_text(encoding='utf-8-sig')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/python3.11/site-packages/latexrestricted/_restricted_pathlib.py", line 202, in read_text
is_readable, reason = self.readable_file()
^^^^^^^^^^^^^^^^^^^^
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/python3.11/site-packages/latexminted/restricted/_latexminted_config.py", line 42, in readable_file
is_latex_writable, _ = ResolvedRestrictedPath(self).writable_file()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/python3.11/site-packages/latexrestricted/_restricted_pathlib.py", line 655, in writable_file
if not any(p.name.startswith('.') for p in (self, resolved)) or self.can_write_dotfiles():
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/python3.11/site-packages/latexrestricted/_restricted_pathlib.py", line 124, in can_write_dotfiles
return latex_config.can_write_dotfiles
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/python3.11/site-packages/latexrestricted/_latex_config.py", line 470, in can_write_dotfiles
self._init_write_settings()
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/pyt
hon3.11/site-packages/latexrestricted/_latex_config.py", line 439, in _init_write_settings
cls._init_tex_paths()
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/pyt
hon3.11/site-packages/latexrestricted/_latex_config.py", line 162, in _init_tex_paths
cls._init_tex_paths_texlive()
File "/var/mobile/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/lib/pyt
hon3.11/site-packages/latexrestricted/_latex_config.py", line 235, in _init_tex_paths_texlive
raise LatexConfigError(
latexrestricted.err.LatexConfigError: Environment variable SELFAUTOLOC has value "/private/var/mobil
e/Containers/Data/Application/D97A139C-A1BB-4E0E-ADED-472F2B5067E7/Library/texlive/2024/bin/arm-darw
in", but a "kpsewhich" executable was not found at that location
system returned with code 1
! Package minted Error: minted v3+ executable is not installed or is not added
to PATH; or MiKTeX is being used with -aux-directory or -output-directory witho
ut setting a TEXMF_OUTPUT_DIRECTORY environment variable.
See the minted package documentation for explanation.
Type H for immediate help.
...
l.6 \end{minted}
?
! Emergency stop.
...
l.6 \end{minted}
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on main.log.
```
MWE:
```tex
\documentclass{article}
\usepackage{minted}
\begin{document}
Hello
\begin{minted}{python}
print("Hello, World!")
\end{minted}
\end{document}
```
I could resolve this manually by creating the directory and a symlink at it pointing the `kpsewhich` in my a-Shell installation (`/private/var/containers/Bundle/Applica
tion/3468C9AC-636E-49CD-9230-56900783E
578/a-Shell.app/bin/kpsewhich`).
Note that I needed to update `fvextra` and `latex2pydata` via `tlmgr` to produce the code snippet.
Why is minted looking for `kpsewhich` in an incorrect PATH?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.