I am currently trying to resolve the issue of outputting my Python code in my LaTex document via the minted package. Originally, I ran into the issue of the "shell-escape flag" Error which, after resolution, gave me the "catchfile" Error. I finally resolved this by eliminating the spaces in my document name, however now I am stuck with the "`Pygmatize'" Error and I am at a loss for what to do here.

I have looked all over the internet for what others have done in the past and have attempted to do the same as them, to no avail. I've installed pygments from the terminal after having to install pips – I can check the version in the terminal and it's saying I have version 2.4.2. I also installed minted and can find the folders using finder. I've created the /~Library/texmf/tex/latex tree and tried putting in the relevant minted.sty file in there so that LaTex can apparently find/read that. I've checked to see that I have minted installed via TeX Live Utility (it's installed).

I have no clue what to do after this. LaTex still won't compile my document and is still giving me the "`Pygmatize'" Error. I've spent way too long trying to find a solution here and just want this document to compile.

I would really appreciate any help with this.

  • 1
    Well while I understand that you are frusted as it is nobody can answer your question. It is completly unclear what you actually did, and what you have installed (and e.g. what has version 2.4.2). And your question contains a lot of typos. But don't start to move manually files around: this will only put your system in a even more unclear state. You have minted.sty - after all it gives an error message - so there is no need to install it again. What do you get on a terminal from pygmentize --help? – Ulrike Fischer Nov 4 '19 at 11:57
  • @Ulrike Fischer, thank you for the response. Here is the first terminal output when I input "pygmentize --help": Usage: /Library/Frameworks/Python.framework/Versions/2.7/bin/pygmentize [-l <lexer> | -g] [-F <filter>[:<options>]] [-f <formatter>] [-O <options>] [-P <option=value>] [-s] [-v] [-x] [-o <outfile>] [<infile>] – Put1demerde Nov 4 '19 at 14:33
  • /Library/Frameworks/Python.framework/Versions/2.7/bin/pygmentize -S <style> -f <formatter> [-a <arg>] [-O <options>] [-P <option=value>] /Library/Frameworks/Python.framework/Versions/2.7/bin/pygmentize -L [<which> ...] /Library/Frameworks/Python.framework/Versions/2.7/bin/pygmentize -N <filename> /Library/Frameworks/Python.framework/Versions/2.7/bin/pygmentize -H <type> <name> /Library/Frameworks/Python.framework/Versions/2.7/bin/pygmentize -h | -V Highlight the input file and write the result to <outfile>. – Put1demerde Nov 4 '19 at 14:34
  • pigmentize -V should give nothing, the name is pygmentize -V. But it looks as if it is installed. Now go in the same terminal to the folder of your tex-document with the minted test and type in the terminal pdflatex --shell-escape name-of-the-tex-file. – Ulrike Fischer Nov 4 '19 at 14:36
  • So sorry, that's my bad. I have been inputting "pygmentize -V" to the terminal. So use the terminal to get to the tex file I'm trying to use minted with? – Put1demerde Nov 4 '19 at 14:40

It seems with some help I found the solution:

I just copied and pasted the "pygmentize" executable unix from /Library/Frameworks/Python.framework/Versions/2.7/bin to /usr/local/bin and it seems to work just fine now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.