"pygmentize: command not found" Even though I already installed pygments on my system

6.9k Views Asked by At

I tried installing pygments on Debian 9 using both apt-get install python3-pygments and pip install Pygments but no method makes it work on the command line.

My suspicion is that my PATH doesn't contain the path of the installations. I added /usr/lib/python3/dist-packages/ to my PATH since the pygments package is installed there but of course this is not a solution since there's not a single bin or executable there. There are scripts there but none with the 'x' permission.

What dir should I add to my PATH variable then? apt-file list python3-pygments only shows the previously added dir (/usr/lib/python3/dist-packages/).

Maybe the problem is unrelated to my PATH. I don't know. But I need to make this work in order to use the minted latex package. There's this quote on the pygments website which makes me think I need to install something else:

You can use Pygments from the shell, provided you installed the pygmentize script.

I wish they could write more about how to install said script since I can't find anything on their website or the internet. For what I see online, most people just install pygments normally and then they are able to use minted so I'm skeptical of this "script".

1

There are 1 best solutions below

0
On

Finally I found it! I uninstalled and re-installed and this time I got the useful warning:

Installing collected packages: Pygments
  WARNING: The script pygmentize.exe is installed in 'C:\Users\CarmanBr\AppData\Local\Programs\Python\Python310\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Updated my path and now it's finally working!