Because of changes in one of the most popular Python installer on Mac, doc needs an improvement (pip3 install Pygments
doesn't work anymore)
#389
Labels
pip3 install Pygments
doesn't work anymore)
#389
On Mac plateform, Python is often installed with the Homebrew package manager (https://en.wikipedia.org/wiki/Homebrew_(package_manager)). But Homebrew is also used on Linux world and the change is not only on HomeBrew.
The change is PEP 668 (https://peps.python.org/pep-0668/).
It was recently implemented in Homebrew, with Python 3.12 (see the very interesting discussion https://github.com/orgs/Homebrew/discussions/3404, titled Python: Mark Homebrew Python as externally managed).
The change is dated from February 21, 2024 (https://github.com/orgs/Homebrew/discussions/3404#discussioncomment-8549228):
The change is this:
pip3 install Pygments
doesn't work anymore.Here is the output:
Luckily, Pygments is available in Homebrew formulas: https://formulae.brew.sh/formula/pygments#default (but on Mac only for the last 3 majors macOS versions).
So,
pip3 install Pygments
can be replaced withbrew install pygments
(for users for whichpip3 install
doesn't work anymore). Other solution, add--break-system-packages
at the end of the command (so usepip3 install Pygments --break-system-packages
), see the note at the end of the error message. Also see https://www.youtube.com/watch?v=sFS6rIZN4Lg (problem not only on the Mac).As on https://github.com/orgs/Homebrew/discussions/3404 some users disagree with the change, perhaps there will be a change which allow further use of
pip3 install
command without having to use a virtual environment.I read in the development status of minted that minted 3.0 will not rely on Pygments, but this change with PEP 668 needs to be documented in the final version of minted 2.x, I think.
The text was updated successfully, but these errors were encountered: