Where are the exported png files generated by my script saved?

My script involves:

  • Calling API and consolidating the data into a pandas dataframe
  • Converting and exporting the dataframe into a png file using dataframe_image library
  • A chatbot will send the png file to the user

When I run the script on my desktop, the png will be saved in my drive. But when I run on pythonanywhere, I am unsure where is my png file located at. Thus, my bot does not send any response to my users.

Any advice is appreciated, thank you.


Sorry Glenn, I should have been more specific and state the exception. I thought it's the file path that's causing the issue but I've tried the suggestion above but to no avail.

Here's the traceback. I'm met with a CalledProcessError but I don't have this issue when I'm running the script on my desktop.

Any idea why this might be so?

Traceback (most recent call last):   File "/home/kimjongbun/.local/lib/python3.10/site-packages/telegram/ext/", line 1184, in process_update
    await coroutine   File "/home/kimjongbun/.local/lib/python3.10/site-packages/telegram/ext/", line 141, in handle_update
    return await self.callback(update, context)   File "/home/kimjongbun/", line 83, in handle_message
    response = handle_response(text)   File "/home/kimjongbun/", line 73, in handle_response
    dfi.export(four_day_df, '/user/kimjongbun/files/home/kimjongbun/SG 4 days weather.png')   File "/home/kimjongbun/.local/lib/python3.10/site-packages/dataframe_image/", line 142, in export
    img_str = converter(html)   File "/home/kimjongbun/.local/lib/python3.10/site-packages/dataframe_image/converter/browser/", line 166, in run
    im = self.screenshot(html)   File "/home/kimjongbun/.local/lib/python3.10/site-packages/dataframe_image/converter/browser/", line 138, in screenshot   File "/usr/local/lib/python3.10/", line 524, in run
    raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['--enable-logging', '--disable-gpu', '--headless', '--crash-dumps-dir=/home/kimjongbun/tmp9md664c5', '--force-device-scale-factor=1', '--window-size=1400,900', '--hide-scrollbars', '--screenshot=/home/kimjongbun/tmp9md664c5/temp.png', '/home/kimjongbun/tmp9md664c5/temp.h tml']' returned non-zero exit status 1.

It looks like an issue with using dataframe-image on PythonAnywhere. I found a previous forum post where a user suggests using df2img instead. Maybe you can try if that works.

Thank you nkahr!

Let us know if it worked for you!