I've recently decided to switch to minted due to way better Python highlighting. I am having weird issues with minted sometimes not being able to find pygmentize on my Mac - never had the same issues on my windows 10 machine.

Steps I took:

  1. Install local Tex Distribution - check
  2. Install pygments > pip install pygments - check
  3. Check if it's installed > $pygmentize -h > Usage .../anaconda/bin/pygmentize - check
  4. Adapt Tex document > \usepackage[chapter]{minted}
  5. Allow TexStudio to shell escape this document > % !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape]> then allow it to really use shell escape for this document
  6. Now I am in a weird state - sometimes after starting TexStudio and setting the document I'll get > Package minted Error: You must havepygmentize' installed to use this package. \begin{document}`. When restarting TexStudio it works fine.

My document consists of one main document that includes the other chapters. Every chapter defines the tex-root like this: %!TEX root = ../doc.tex. The minimal example I've tried (which works flawlessly on win and sometimes on mac)

int main() {
printf("hello, world");
return 0;

I am grateful for any ideas you might have :).

  • This sounds like a PATH problem within TeXStudio. Try to typeset manually in Terminal. Jan 8, 2018 at 19:20
  • I can only speak for my system after TeXStudio typesetting the document without hiccups again but this works as well - it is kind of a weird issue sometimes.
    – Faust
    Jan 9, 2018 at 9:05

1 Answer 1


It appear TexStudio is not looking for pygmentize at the right place. So you need to create a symlink :

sudo ln -s "$(which pygmentize)" /Library/TeX/texbin/pygmentize

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .