My telegram bot code has line (tried all three). This code works normally on local computer but when upload to Heroku, can't make it to create image of dataframe and send to user. Can't understand why it happens.
import dataframe_image as dfi
dfi.export(ddf2, "table.png")
dfi.export(ddf2, str(user)+".png")
dfi.export(ddf2, str(user)+".png",table_conversion='chrome')
2022-07-29T06:03:20.632128+00:00 app[worker.1]: File "/app/t_bot.py", line 191, in out
2022-07-29T06:03:20.632266+00:00 app[worker.1]: dfi.export(ddf2, str(user)+".png",table_conversion='chrome', chrome_path='/app/.chromedriver/bin/chromedriver')
2022-07-29T06:03:20.632279+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/dataframe_image/_pandas_accessor.py", line 24, in export
2022-07-29T06:03:20.632375+00:00 app[worker.1]: return _export(obj, filename, fontsize, max_rows, max_cols, table_conversion, chrome_path)
2022-07-29T06:03:20.632383+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/dataframe_image/_pandas_accessor.py", line 73, in _export
2022-07-29T06:03:20.632462+00:00 app[worker.1]: img_str = converter(html)
2022-07-29T06:03:20.632471+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/dataframe_image/_screenshot.py", line 167, in run
2022-07-29T06:03:20.632585+00:00 app[worker.1]: img = self.take_screenshot()
2022-07-29T06:03:20.632586+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/dataframe_image/_screenshot.py", line 119, in take_screenshot
2022-07-29T06:03:20.632679+00:00 app[worker.1]: img = mimage.imread(buffer)
2022-07-29T06:03:20.632683+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/matplotlib/image.py", line 1560, in imread
2022-07-29T06:03:20.633021+00:00 app[worker.1]: with img_open(fname) as image:
2022-07-29T06:03:20.633021+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/PIL/ImageFile.py", line 116, in __init__
2022-07-29T06:03:20.633127+00:00 app[worker.1]: self._open()
2022-07-29T06:03:20.633145+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/PIL/PngImagePlugin.py", line 712, in _open
2022-07-29T06:03:20.633388+00:00 app[worker.1]: raise SyntaxError("not a PNG file")
2022-07-29T06:03:20.633425+00:00 app[worker.1]: SyntaxError: not a PNG file
I'm adding PyCharm script to show that DataFrame works normally and exports normally on local device.