anoved / OctoPrint-EmailNotifier

Receive email notifications when OctoPrint jobs are complete. Currently broken. Please fork and fix!
GNU Affero General Public License v3.0
16 stars 35 forks source link

Can't store password #27

Open mdiorio opened 7 years ago

mdiorio commented 7 years ago

Latest OctoPi installed and fully updated.

Traceback (most recent call last): File "", line 1, in File "/home/pi/oprint/local/lib/python2.7/site-packages/yagmail/yagmail.py", line 430, in register keyring.set_password('yagmail', username, password) NameError: global name 'keyring' is not defined

(oprint)pi@octopi:~/oprint/bin $ pip install keyrings.alt Requirement already satisfied (use --upgrade to upgrade): keyrings.alt in /home/pi/oprint/lib/python2.7/site-packages

keyrings.alt is installed, but I still can't store the password. Any ideas? Thanks!

madmax2 commented 7 years ago

Also get same problem

HugoTheBoss commented 7 years ago

For me the same

Traceback (most recent call last): File "", line 1, in File "/home/pi/oprint/local/lib/python2.7/site-packages/yagmail/yagmail.py", line 430, in register keyring.set_password('yagmail', username, password) NameError: global name 'keyring' is not defined

kerios69780 commented 7 years ago

Hello, I had the same issue. I ran the command "/home/pi/oprint/bin/pip install keyring" (and not keyrings.alt) and now I can store passwords. I did not test it though.

Hope this may help.

anoved commented 7 years ago

Hi all. I realize installation and setup problems with yagmail are the source of most frustrations with this plugin. Bear with me as I try to figure out more about how it works in order to simplify the process or at least document it better.

A few points:

(Please disregard if this is old news to you; posting here partly for my own reference.)

KyneSilverhide commented 7 years ago

I have the same error. I tried to install keyring manually but it still fails. Octopi and yagmail are up to date.

yagmail.register('mail@gmail.com', 'my_awesome_password') Traceback (most recent call last): File "", line 1, in File "/home/pi/oprint/local/lib/python2.7/site-packages/yagmail/yagmail.py", line 435, in register keyring.set_password('yagmail', username, password) NameError: global name 'keyring' is not defined

The problems seems to be yagmail related.

rcooklo commented 7 years ago

This is how I got it working today. I loaded the email plugin and restarted the OctoPrint service. I have an OctoPi I loaded by hand. The path (which is the new default) to the OctoPrint python is /home/pi/OctoPrint/venv/bin. I could not get keyring to load unless I used the --no-deps flag, but the emails work so I don't care about the dependencies. So while logged in as the user pi I loaded keyring and yagmail with the following commands: ~/OctoPrint/venv/bin/pip install keyring --no-deps ~/OctoPrint/venv/bin/pip install yagmail Then I started python, imported yagmail and keyring, and then I could register my gmail address and password. Start python with the command: ~/OctoPrint/venv/bin/python Then while in python type the next three lines (note: use your gmail address and password) import yagmail import keyring yagmail.register('youraddress.gmail.com', 'yourgmailpassword') Then I typed CTL-Z to exit python and rebooted. I probably only needed to restart the OctoPrint service. Then the test email worked, yay! I hope this helps someone else, I spent 3 or 4 hours testing to figure this out.

SurfingSpider commented 7 years ago

I just got it working by manually installing the keyring

~/oprint/bin/pip install keyring

Then adding the commend "import keyring" into the python commands given in the README.md

 ~/oprint/bin/python
>>> import yagmail
>>> import keyring
>>> yagmail.register("SMTP username", "SMTP password")

p.s. I didn't update the yagmail or anything just stock from the octopi image on the RPI3

KyneSilverhide commented 7 years ago

I followed the instructions from rcooklo and it works now.