2

I am trying to tell pandoc to use a custom pandocfilter written in python. I am on a MacBook M1 and therefore there is a 2.7 and a homebrewed 3.9.7 version of python installed.

For some reason the pandocfilter module is not found despite being installed correctly.

This is the script I'm trying to use:

#!/usr/bin/env python3

from pandocfilters import toJSONFilter, Str
import re

def replace(key, value, format, meta):
    if key == 'Str':
        if '[[' in value:
            new_value = value.replace('[[', '')
            return Str(new_value)
        if ']]' in value:
            new_value = value.replace(']]', '')
            return Str(new_value)

if __name__ == '__main__':
    toJSONFilter(replace)

/usr/bin/env python3 points to the correct python version so I have no clue where the issue may be.

I'm looking forward for any help!

tim_hilde
  • 21
  • 1
  • Does this answer your question? ['Python not found' despite having been installed](https://stackoverflow.com/questions/66408996/python-not-found-despite-having-been-installed) – BSP Oct 27 '21 at 11:00
  • No, the issue is not that python is not found but a module – tim_hilde Oct 27 '21 at 11:04

0 Answers0