Textract - windows10 - shell error - failed with exit code 127

363 views Asked by At

The below code works fine for txt file but doesn't work with pdf files.

import textract
text = textract.process(r'C:\Users\Python_files\accounts.txt')

However, I cannot seem to figure out what the problem is in the below code snippet:

import textract
path = r'C:\Users\Python_files\accounts.pdf'
text = textract.process(path)

The above code results in the following error:

ShellError: The command `pdftotext C:\Users\Python_files\accounts.pdf -` failed with exit code 127
------------- stdout -------------
------------- stderr -------------
0

There are 0 answers