I have run into a roadblock. It so happens another student, Ahmad, has run into a largely similar roadblock at the same time. So far, we don't have an answer from the Udacity forums, so I thought I would cross post here in hopes of getting help sooner rather than later. The problems comes up here: Web Development - Lesson 2 - More Handlers. (The link might not work if you aren't logged-in).
Up until this point, both of us were getting it right and making progress, but from here on, things shut down and we are both stumped. Here is my last post back to Ahmad:
I compared your log with mine in MS Word. When you get rid of things like time of day, font, and file path, there are a couple of differences. We both got:
WARNING api_server.py:331] Could not initialize images API; you are likely missing the Python "PIL" module.
And
ERROR wsgi.py:262]
Our tracebacks are nearly identical
Traceback (most recent call last): File "C:\Program Files\ (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 239, in Handle handler = _config_handle.add_wsgi_middleware(self._LoadHandler()) File "C:\Program Files\ (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 298, in _LoadHandler handler, path, err = LoadObject(self._handler) File "C:\Program Files\ (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 84, in LoadObject obj = import(path[0])
but we have different form actions
(/<form action ="/testform, TestHandler)],">
One thing I have that you don’t is
WARNING 2013-12-09 18:18:41,795 simple_search_stub.py:1018] Could not read search indexes from c:\users\appdata\local\temp\appengine.udacity7676\search_indexes
So where do we go from here? I don’t know, but I do have a lot of questions I hope someone can and will answer:
- If this PIL module is so crucial, why is it a separate download? And why didn’t GAE tell us that before now?
- Why did we both succeed with the Udacity quizzes until this point? Put another way, what is so different about this exercise that suddenly makes PIL crucial?
- I looked at PIL on the app engine site. https://developers.google.com/appengine/docs/python/images/ It is an image manipulator, and the example they give is with the gae icon. That makes me wonder if our progress on this lesson has been shipwrecked by someone requiring the icon be part of the result? As near as I can tell, there are no images in this exercise, and I don’t know of ANY app where the lack of a favicon makes the whole thing crash. If that’s what’s going on, that’s just crazy and wasteful.
- I went to the PIL download site. Turns out the installer not only expects to find Python at the default location [c:\python27], there is NO WAY to give it another path. I tried – many times. Since my python is not at the default location, either I am out of luck or I have to reinstall it there, and start all over again. How nice and thoughtful of these engineers to be so flexible in working with newbies like us.
- I am mindful of the fact that you said you had in fact already installed PIL, but you got this error message anyway. So what do we do with that?
- I also compared the code in the lesson with the code I have for this exercise.
- I have
MainHandler, they haveMainPage, which I had noticed before, but I don’t think this is significant. Besides, mine came with this name, I didn’t create it. - The triple quotes seem to be spaced differently, but I’m pretty sure I heard elsewhere that spacing doesn’t matter, so that shouldn’t be a problem.
- I don’t have the content-type line, the instructor commented his out.
- He adds
out, as inself.response.out.write(form). This was not in my default files. I just haveself.response.write(form).
The
(/<form action ="/testform, TestHandler)],">does not look right.It should be
<form action="/testform">only.The
PILlibrary is not at all necessary for the GAE (in your case at the least). So, it's just a warning which you can ignore. (It has nothing to do with your errors)The
MainHandlerreplaced withMainPageis not at all a problem if you have used the correct Handlerclassin theappdeclaration at the end. Something like,Also, the spacing doesn't matter, but the block in which you place the triple-quoted strings matters. e.g.
would give error, but,
this would work fine.
As for the actual problem you two are facing, I can't help you if I can't have a look at the code. If you want the discussion to continue on the Udacity forums, it's fine by me, but then, post a link & I will see what I can do.
Update - Looks like you missed adding commas to separate the tuples in your URL-Handlers declaration. Your code looks like
while it should be