alexgreene / WikiQuiz

Generates a quiz for a Wikipedia page using parts of speech and text chunking.
MIT License
803 stars 58 forks source link

HTTP 500 error #1

Closed dzflack closed 7 years ago

dzflack commented 7 years ago
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger pin code: 640-888-131
127.0.0.1 - - [19/Feb/2017 10:40:48] "GET /quiz/Honda/ HTTP/1.1" 500 -
alexgreene commented 7 years ago

@dzflack Does this happen for other articles as well? (ie. 'football', 'kangaroo', 'spider man')

Also, what version of Python are you using?

dzflack commented 7 years ago

Yup for all articles.

* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger pin code: 640-888-131
127.0.0.1 - - [19/Feb/2017 11:19:44] "GET /quiz/football/ HTTP/1.1" 500 -
127.0.0.1 - - [19/Feb/2017 11:20:48] "GET /quiz/kangaroo/ HTTP/1.1" 500 -
127.0.0.1 - - [19/Feb/2017 11:20:59] "GET /quiz/spider%20man/ HTTP/1.1" 500 -

Tried on both Python 2.7.13 and Python 3.6.0

alexgreene commented 7 years ago

@dzflack In server.py, I have a try/except wrapping everything, but clearly it's having the adverse effect of hiding the root of the problem. If you remove lines 14,27,28 (try: and except: resp = Response("ERROR", status=500, mimetype='application/json')), the error should spit out on the command line.

Very curious to see what it will be.

alexgreene commented 7 years ago

@dzflack

kercker 0 minutes ago [-]

I got this problem too.
I solved it by downloading 'averaged_perceptron_tagger' from nltk.
>>>import nltk
>>>nltk.download('averaged_perceptron_tagger')

Hope that works!

kercker commented 7 years ago

I think the problem is because this app depends on the package 'averaged_perceptron_tagger' from nltk. I solved this problem by downloading it from nltk.

import nltk nltk.download('averaged_perceptron_tagger')

dzflack commented 7 years ago

Yup thats it thanks 👍

alexgreene commented 7 years ago

Going to add this to the README right now, I forgot I had done this. Sorry for any confusion!