blissend / hqtrivia-automation

Automate finding better answers in HQ Trivia. This is for educational purposes only!
GNU General Public License v3.0
49 stars 15 forks source link

"Import Error: No Module named ..." #8

Open jmelman87 opened 6 years ago

jmelman87 commented 6 years ago

I'm having an issue with vocabulary.vocabulary . I get the following error.

File "hqtrivia-automation.py", line 9, in import Vocabulary # online dictionary ImportError: No module named Vocabulary

Help please?

jmelman87 commented 6 years ago

Additionally, I am confused altogether on how I am supposed to use this. I have Google Vision. Could someone please help me out and walk me through exactly how to run this? I am not the best with programming, but this project really interests me.

blissend commented 6 years ago

Sorry for slow response. Been gone on a long vacation over the holidays.

For missing module, did you run the following... pip3 install -r requirements.txt

If so, type... pip3 list And comment back with results.

Also type... python3 -m site And see if vocabulary.py is located in any of those directories the above spits out.

For google vision setup yes the docs on this are a HUGE mess. Unfortunately I blazed through without documenting how I figured it out but after some research I think I followed this doc https://googlecloudplatform.github.io/google-cloud-python/latest/core/auth.html which ultimately lead to https://cloud.google.com/storage/docs/authentication#generating-a-private-key. That doc shows how to generate a .json auth key for the service account (may have to create one) connected to your google vision. So do the following...

  1. Follow steps here https://cloud.google.com/storage/docs/authentication#generating-a-private-key for creation .json file
  2. Put the .json file in same directory as hqtrivia-automation script and rename it to gvision_auth.json

Download latest hqtrivia-automation script and test again.