bluenevus commited on
Commit
4869991
·
verified ·
1 Parent(s): 1bb1cee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -7,6 +7,23 @@ import dash_bootstrap_components as dbc
7
  import threading
8
  import time
9
  import pypandoc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
  app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
12
 
 
7
  import threading
8
  import time
9
  import pypandoc
10
+ import os
11
+
12
+ # Check if pandoc is installed
13
+ try:
14
+ pypandoc.get_pandoc_version()
15
+ except OSError:
16
+ # If not found, attempt to download and install
17
+ print("Pandoc not found. Attempting to download...")
18
+ pypandoc.download_pandoc()
19
+
20
+ # Verify installation
21
+ try:
22
+ pypandoc.get_pandoc_version()
23
+ print("Pandoc successfully installed.")
24
+ except OSError:
25
+ print("Failed to install Pandoc. Please install it manually.")
26
+ exit(1)
27
 
28
  app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
29