I installed minted today as well as Python and Pygments, which I can run from the cmd. When I try this code:

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

I get the following error message:

! Package minted Error: Missing Pygments output; \inputminted was
probably given a file that does not exist--otherwise, you may need the
outputdir package option, or may be using an incompatible build tool,
or may be using frozencache with a missing file.

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

The other threads didn't help me and neither did Google. How do I solve this problem? I have set my option in pdfLatex to:

pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %filename.tex 

Here is my log file.

My PATH is set so I can execute Python and pygmentize from the cmd without errors, and I can load the package as well. When it comes to using the minted package is when I receive the error.

  • what pdflatex commandline did you use (in particular did you use -output-directory ? Commented Jul 13, 2018 at 17:36
  • @DavidCarlisle Hi, thank you for the swift reply. The command line I used is pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex
    – BlackBear
    Commented Jul 13, 2018 at 18:08
  • I just tried that exact command and your file worked for me. can you show the full log file? Commented Jul 13, 2018 at 18:15
  • 1
    For those that get this error message when typesetting via Texpad, try including minted via \usepackage[cache=false,outputdir=.texpadtmp]{minted}. If you're not a Texpad user, \usepackage[cache=false]{minted} might help. These answers originate from this Github issue: github.com/gpoore/minted/issues/81
    – fredpi
    Commented Sep 14, 2021 at 21:49
  • 2
    For me the problem was that for some reason I didn't have sufficient permissions to run pygmentize. My solution was to go to change the permission settings of C:\ProgramData\Anaconda3\Scripts\pygmentize.exe so that anyone has the permission to run it. Commented Oct 31, 2021 at 17:23

3 Answers 3


For me this was due to two seperate problems: I didn't have enough privileges to run pygmentize, and I specified an -aux-directory argument to pdflatex without telling minted to look for the output file there. I had to fix both problems for it to work.

Insufficient privileges to run pygmentize

One of the problems was that for some reason I didn't have sufficient permissions to run pygmentize. To solve this on Windows, follow these steps:

  1. Go to the folder containing pygmentize.exe in Windows Explorer (for me it's C:\ProgramData\Anaconda3\Scripts\pygmentize.exe). If you don't know what folder that is, you can find it by running where pygmentize.exe in cmd.exe (if that command gives you an error you need to set up pygmentize as explained here).

  2. Right click on pygmentize.exe, then click on Properties > Security > Advanced > Continue:

    enter image description here

    (Sorry that it's in Swedish, but the buttons should be in the same place in any language. "Säkerhet" means "Security", "Avancerat" means "Advanced" and "Fortsätt" means "Continue".)

  3. Next, click on Add > Choose a main account:

    enter image description here

    ("Lägg till" means "Add", "Välj ett huvudkonto" means "Choose a main account")

  4. In the text box, type "Users" in your system language (so if your system is in English type "Users", if it's in Swedish type "Användare", if it's in French type "Utilisateurs", etc). Then click on "Control Name", then "OK".

    If it complains that what you typed is invalid, you can go to Advanced > Search Now to see a list of valid options, there should be something in there that means "Users". Alternatively, if you only need it to work for your user account, you can also type your Windows username.

  5. Check the checkboxes "Read" and "Read and Execute", and make sure "Allow" is selected under "Type":

    enter image description here

    ("Läsa" means "read", "köra" means "execute", "Typ" means "Type" and "Tillåt" means "Allow")

  6. Click OK on each window you've opened.

-aux-directory in pdflatex

If you've specified an -aux-directory argument to pdflatex (which you can do in TeXstudio by going to Settings > Configure TeXstudio > Commands > PdfLaTeX), you need to explicitly specify that as ouptupdir to the minted package. For example, I use -aux-directory=C:/Users/myname/AppData/Local/Temp, so I needed to do \usepackage[outputdir=C:/Users/myname/AppData/Local/Temp]{minted} insead of just \usepackage{minted}.

In general the outputdir should be the one where Latex puts auxiliary files, in this case the file that's interesting is the .pygtex file. If you haven't specified an -aux-directory the default should be your current working directory in both cases so you shouldn't need to do anything, but if it still doesn't work you might need to search for where it put the .pygtex file and specify that as outputdir.

  • 2
    Using an auxdir is almost never a good idea. You'll run into so many strange problems. Commented Feb 25, 2023 at 12:23
  • 2
    The OP explicitly says that they can run pygmentize "My PATH is set so I can execute Python and pygmentize from the cmd without errors, " so while changing the pygmentize settings may have solved your problem, it is not an answer to the question asked Commented Feb 26, 2023 at 20:15
  • @DavidCarlisle Even if it's not helpful to the OP, it might be helpful to other who find this question through Google. The purpose of Stack Exchange is to help future readers, not just the OP. Commented Feb 27, 2023 at 10:23
  • 1
    yes but helpfully answering a different question doesn't really fit the format. If the question is how to set up tex to call an installed pygments. An answer on how to install pygments is obviously related but not really an answer. Does no harm though, I would not have commented except for the fact that you asked in meta why the question was closed and the reason was it was not reproducible and had no answer as posted. Commented Feb 27, 2023 at 12:06
  • Using the outputdir option in minted also works for output-directory in latexmk
    – Kazh
    Commented Aug 31, 2023 at 3:21

Your codes are working fine for me, I've tried the following commands I used the DOS prompt to get the output, hope --shell-escape is the solution for your problem, but not sure, please try at your end:

latex --shell-escape %filename.tex to get the output as in DVI format

pdflatex --shell-escape %filename.tex to get the output as in PDF format

and the output was generated as:

enter image description here

  • thank you for your reply. I have tried your proposed solution, but unfortunately it gave me the same error. Perhaps there is something wrong with my PATH environment or my directory? Unfortunately, I am not tech savy enough to know this. I probably forgot something crucial and/or obvious.
    – BlackBear
    Commented Jul 14, 2018 at 8:04
  • Can you tell me what release of LaTeX you are using? I am using MikTeX version 2.9 in Windows OS...
    – MadyYuvi
    Commented Jul 14, 2018 at 15:27
  • I am using MikTex 2.9.6 and TexMaker 5.0
    – BlackBear
    Commented Jul 15, 2018 at 15:57
  • -shell-escape does not solve this problem.
    – Sam7919
    Commented Jul 20, 2023 at 15:11

I had properly used -shell-escape and installed Pygments. I was still getting the error.

The reason was I was using \begin{minted}{txt} and not \begin{minted}{text}.

Make sure you are using a Pygments supported language. (There is only a short name entry for text not txt.)

  • That's not it. I'm using -shell-escape and the problem is still there.
    – Sam7919
    Commented Jul 20, 2023 at 15:10
  • That's not it. You did not read this answer.
    – mcp
    Commented Jul 21, 2023 at 16:58

You must log in to answer this question.

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