Exaphis / HackQ-Trivia

Yet another HQ Trivia bot. Automatically scrapes HQ Trivia questions without OCR and answers them.
MIT License
89 stars 54 forks source link

Resource punkt not found. #14

Closed ghost closed 6 years ago

ghost commented 6 years ago

Thanks a lot for sharing this! Thought I had everything working, but I appear to have done something wrong with installing or importing nltk (see image for error). I had added...

import nltk nltk.download("stopwords") nltk.download("averaged_perceptron_tagger")

...to the top of hq_main.py instead of executing those lines beforehand, as I was having trouble getting them to run in terminal (for example, after trying to execute "import nltk" in the terminal, I received "-bash: import: command not found"). The following was outputted to the terminal, which made me think this approach would work:

"[nltk_data] Downloading package stopwords to [nltk_data] /Users/JohnSmith/nltk_data... [nltk_data] Package stopwords is already up-to-date! [nltk_data] Downloading package averaged_perceptron_tagger to [nltk_data] /Users/JohnSmith/nltk_data... [nltk_data] Package averaged_perceptron_tagger is already up-to- [nltk_data] date!

New to using the command line here, so sorry for what I'm guessing is a rookie mistake. screen shot 2018-03-13 at 9 23 13 pm

Exaphis commented 6 years ago

Try adding nltk.download("punkt") to the top of hq_main. You could also run python3 by itself in terminal to open Python, then run the 3 install commands.

ghost commented 6 years ago

worked perfectly, thanks again!