3

I have 2 versions of Python on my machine. Version 2.7.10 can be invoked with python, whereas python3 uses 3.5.0 under the hood.

I'd like to use minted with python3, which is why I installed Pygments via pip3. When I compile a LaTeX document that contains minted macros, it can't find the library. I assume minted uses the standard python command and therefore version 2.7.10, which doesn't have Pygments installed.

Is there a way to tell minted to switch to version 3?

EDIT: As pointed out by G. Poore, minted invokes pygmentize. Although which pygmentize points to Pygments under version 3, I tried to set it manually:

\usepackage{minted}
\renewcommand{\MintedPygmentize}{/path/to/pygmentize}

Unfortunately I still get You must have 'pygmentize' installed to use this package with minted 2.1.

3

minted invokes the pygmentize script, which provides a command-line interface to Pygments. If minted can't find pygmentize, then the command-line scripts for Python 3 aren't available, and you probably need to modify your PATH.

2

I figured out that in my particular case TeXShop was causing the error. One must create a symlink within /Library/TeX/texbin to pygmentize (see this answer). Afterwards you can also omit to reset \MintedPygmentize.

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.