Outline
Original Post
PythonAnywhere – Tasks Executed Correctly But Inserting Database Failed
I ran a task on PythonAnywhere, fetching data and inserting to MySQL database in this code. Everything worked fine when I execute it manually. And when executing automatically, it showed finished in log file, but new data was not uploaded to database. Why?
I tried to fix my python file, and ran it over and over again. Finally, I found the stupid mistake. You just have to add the “python3.X” before the file path, like the example in Schedule tasks field.

# Wrong
/home/aronhack/agri_wholesale/Agriculture_Wholesale_Update.py
# Correct
python3.7 /home/aronhack/agri_wholesale/Agriculture_Wholesale_Update.py