Advertisement
para_bellum

latex, minted and pygmentize

Jun 8th, 2016
535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. The minted package of LaTeX uses the Python module "pygmentize" to colour the code snippets.
  2. From time to time, this could arise:
  3.  
  4. ```
  5. para@N551JK-ULB:~/Documents/ULB/ELECH310/2015-2016/examen/exam_test_cls$ pygmentize
  6. Traceback (most recent call last):
  7. File "/usr/local/bin/pygmentize", line 5, in <module>
  8. from pkg_resources import load_entry_point
  9. File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
  10. @_call_aside
  11. File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
  12. f(*args, **kwargs)
  13. File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
  14. working_set = WorkingSet._build_master()
  15. File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 637, in _build_master
  16. return cls._build_from_requirements(__requires__)
  17. File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 650, in _build_from_requirements
  18. dists = ws.resolve(reqs, Environment())
  19. File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 829, in resolve
  20. raise DistributionNotFound(req, requirers)
  21. pkg_resources.DistributionNotFound: The 'Pygments==2.1' distribution was not found and is required by the application
  22. ```
  23.  
  24. Upgrading pygmentize won't do it, the script is broken. You need to locate it and manually change the "pygments" version to the one you have installed on your system (in my case 2.1.3 instead of the 2.1 required in the script).
  25.  
  26. ```
  27. $ pip freeeze
  28. ...
  29. Pygments==2.1.3
  30. ...
  31. $ sudo vim `which pygmentize`
  32. ```
  33.  
  34. Now it works.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement