neerajkalyank commited on
Commit
4f8402b
1 Parent(s): 65e6063

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -1,6 +1,12 @@
 
1
  import camelot
2
  import pandas as pd
3
  import gradio as gr
 
 
 
 
 
4
 
5
  def extract_tables(pdf_file):
6
  tables = camelot.read_pdf(pdf_file.name, pages="all")
 
1
+ import subprocess
2
  import camelot
3
  import pandas as pd
4
  import gradio as gr
5
+ try:
6
+ camelot.__version__
7
+ except ImportError:
8
+ subprocess.run(["apt-get", "update"])
9
+ subprocess.run(["apt-get", "install", "-y", "ghostscript"])
10
 
11
  def extract_tables(pdf_file):
12
  tables = camelot.read_pdf(pdf_file.name, pages="all")