tabula-py ImportError: cannot import name 'read_pdf'

DanielHe picture DanielHe · Dec 22, 2017 · Viewed 18.2k times · Source

Im trying to use tabula-py to transfer a table from pdf to excel.

When im trying to

from tabula import read_pdf

it says

ImportError: cannot import name 'read_pdf'

All solutions i found say that i have to

pip uninstall tabula
pip3 install tabula-py

https://github.com/chezou/tabula-py/issues/47

Tabula-py - ImportError: No module named tabula

But its still not working for me.

Any ideas?

Answer

Jay Haran picture Jay Haran · Apr 24, 2018
from tabula import wrapper
df = wrapper.read_pdf('my_pdf')

read_pdf is contained within 'wrapper'. Hence you import wrapper and call read_pdf from wrapper.