I am using TexShop on mac OS X 10.11.1 and I'm trying to output some Python code inside my LaTeX document.
Here is an example of a document I would want to produce :
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}
\usepackage{minted}
\begin{document}
\begin{minted}{python}
def __init__(self, x, y):
self.x=x
self.y=y
\end{minted}
\end{document}
My LaTeX compile command is pdflatex --file-line-error --synctex=1 --shell-escape --interaction=nonstopmode.
When the command is run directly from the terminal, it works fine. But whenever I try to compile the document from TexShop, I get the following error :
sh: /Library/TeX/texbin/pygmentize: cannot execute binary file
I also got this error previously :
sh: /Library/TeX/texbin/pygmentize: access denied
I have Python installed, minted package up to date, pygmentize installed and located at ~/anaconda/bin/pygmentize, with symbolic links the following directories : /usr/local/bin/, /usr/local/texlive/2015/bin/x86_64-darwin/ and /Library/Tex/texbin/.
Now, what can I do to get minted to work
By the way, if I run this test file
\catcode`:=\active
\def:{\par}
\parindent0pt\tt
\input|"echo $PATH"
\bigskip
Is there pygmentize?
\input|"which pygmentize"
\bye
I get
/Users/philippe/anaconda/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Library/TeX/texbin
Is there pygmentize?
/Users/philippe/anaconda/bin/pygmentize
pygmentizeat the wrong location. – jarauh Nov 20 '15 at 16:55pygmentizefile (/Library/TeX/texbin/pygmentize). The error would be different I suppose if the file was not found. – le petit prince Nov 20 '15 at 18:40/Library/Tex/texbin/by an actual copy ofpygmentizeand it works fine! – le petit prince Nov 20 '15 at 18:50