oliver006 / elasticsearch-gmail

Index your Gmail Inbox with Elasticsearch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to run the example? (I get ImportError when running the script)

kaiwaehner opened this issue · comments

Can you please add a step-by-step explanation how to run the example? (I have no experience with Python coding, just want to run the example).

Python is installed. I also executed your PIP commands (was already included in Anaconda).
I have downloaded your source code (one Python file) in the same folder as the emails.mbox file from Google. I tried:

python index_emails.py
Traceback (most recent call last):
File "index_emails.py", line 12, in
from DelegatingEmailParser import DelegatingEmailParser
ImportError: No module named DelegatingEmailParser

Thanks for reporting this, let me look into it.

I have downloaded your source code (one Python file) - looks like you're missing the rest of the .py files?

Right! I now cloned the whole project to have all code... I also renamed my downloaded Gmail file to emails.mbox and copied it into the 'src' folder...

However, I wonder: What is the exact command to start the Python program? Or how do I have to adjust the code to point to my downloaded Gmail mbox file?

This information is missing in the readme, unfortunately.

Try something like python index_emails.py --infile=emails.mbox

The command line parameters are parsed down here: https://github.com/oliver006/elasticsearch-gmail/blob/master/src/index_emails.py#L192-L218

Adding a section about how to run the task is a good idea, unfortunately I don't have time to update the tutorial right now due to prior commitments but PRs are welcome.

I updated the README to include more information on how to run this.