Forums

deleted all my files in hopes to start again

I started a project 2 days ago and went through the tutorial fine. Today, I came back to the project and I was getting "No module named 'processing'".

I thought it was because i initialized the project with python 3.7 but noticed it was running 3.8. I don't know that was the issue but i thought i could restart everything by deleting the files and somehow restarting that way... i think this just made it worse.

Is there anyway i can go from here?

What errors are you currently getting?

I was able to get past that part above. I think what i was looking for was the Delete option at the bottom of 'Web'. Seems like this sort of let's me restart. In the end my problem was i wasn't following the tutorial correctly.

Now I'm at the end of the tutorial and the error I'm getting is Error code: Unhandled Exception

I've checked the processing code in my local IDE and it seems to work fine there. I think it's my flask_app.py file that is probably the issue. Any advice?

I think this is the answer to the question. In my error log here are the errors I'm getting now

2020-07-12 17:41:35,853: Error running WSGI application 2020-07-12 17:41:35,965: EOFError: EOF when reading a line

What is below that line? Could you paste full error?

2020-07-13 10:38:20,166: Error running WSGI application 2020-07-13 10:38:20,166: EOFError: EOF when reading a line 2020-07-13 10:38:20,166: File "/var/www/costarica_pythonanywhere_com_wsgi.py", line 16, in <module> 2020-07-13 10:38:20,167: from flask_app import app as application # noqa 2020-07-13 10:38:20,167: 2020-07-13 10:38:20,167: File "/home/CostaRica/mysite/flask_app.py", line 3, in <module> 2020-07-13 10:38:20,167: from processing import process_data 2020-07-13 10:38:20,167: 2020-07-13 10:38:20,167: File "/home/CostaRica/mysite/processing.py", line 10, in <module> 2020-07-13 10:38:20,167: input_filename = input("Enter the input filename: ") 2020-07-13 10:38:20,167: ********* 2020-07-13 10:38:20,167: If you're seeing an import error and don't know why, 2020-07-13 10:38:20,168: we have a dedicated help page to help you debug: 2020-07-13 10:38:20,168: https://help.pythonanywhere.com/pages/DebuggingImportError/

You cannot use input in a web app. There is no console where that prompt could be displayed and no console where the response could be entered. We have a blog post on converting command line scripts to run as web apps here: https://blog.pythonanywhere.com/169/

Thank you for bearing with me. It looks like again I wasn't following the tutorial precisely. But it is working now.

Specifically, i was on that blog post ("Processing files" section) and confused by what i was supposed to enter in the processing.py file. But the blog is actually pretty clear. The part I was writing into my processing.py file was actually just an example for a local script without flask and the part i should have written in was below that.