Ojasvi Jain
Ojasvi Jain

Reputation: 89

How to fix this error on tabula.read_pdf() function in Python

I am trying to extract tables from a PDF file using Python (Pycharm).

I tried the following code:

 from tabula import wrapper
 object = wrapper.read_pdf("C:/Users/Ojasvi/Desktop/sample.pdf")

However, the error i got was:

"tabula.errors.JavaNotFoundError: `java` command is not found from this Python process. Please ensure Java is installed and PATH is set for `java`"

Upvotes: 4

Views: 19929

Answers (2)

Tokci
Tokci

Reputation: 1280

I had every thing setup Java installed and Java path setup but was still getting same error, after spending half a day , I did below and everything worked.

I was using a python environment and running Tabula in python environment. I was getting error mentioned in questions.

I changed my python environment basically default one which is no environment and everything worked. I think Tabula is not able to detect Java once we are inside an python environment.

Upvotes: 1

dome
dome

Reputation: 841

You probably need to add java to your system path. You can check those posts, they should help you in solving your problem:

Upvotes: 4

Related Questions