Unable read OCR PDF in Python

287 Views Asked by At

I'm trying to read a .pdf file for the first time in python, This file has OCR in it.

from wand.image import Image
from PIL import Image as PI
#import pyocrfrom PythonMagick import Image
from PythonMagick import Image
import pyocr.builders
import io

im = Image()
im.read(r"D:/test.pdf")

I have downloaded PythonMagick file which has .whl extension, as directed in this post But still I get error ModuleNotFoundError: No module named 'PythonMagick'

How and what step should be followed so that I could be able to read the OCR PDF in python. Any suggestions are appreciated. Thanks

1

There are 1 best solutions below

3
On

.whl is not the file you meant do download. Install pip tools and use pip install PythonMagick command. Installing pip is a little bit complicated if you are using Windows.