I need to run Libreoffice --covert-to
to convert an excel file to html page.
The current code works well within the windows machine. But in AWS, CentOS6, it's producing an error as "Failed to open display".
Here is my code
import subprocess
cwdir = '/opt/libreoffice6.2/program'
excel_path = '/home/ec2-user/PythonCode/testing/Book1.xlsx'
dest_path = '/home/ec2-user/PythonCode/testing'
html_command = ["soffice", "--headless", "--convert-to", "html", "--outdir",
dest_path, excel_path]
subprocess.run(html_command, shell=True, cwd=cwdir)`