OctoPrint-EmailNotifier icon indicating copy to clipboard operation
OctoPrint-EmailNotifier copied to clipboard

Can't store password

Open mdiorio opened this issue 7 years ago • 8 comments

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!

mdiorio avatar Mar 09 '17 21:03 mdiorio

Also get same problem

madmax2 avatar Mar 12 '17 01:03 madmax2

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

HugoTheBoss avatar Mar 19 '17 12:03 HugoTheBoss

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.

kerios69780 avatar Apr 12 '17 05:04 kerios69780

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:

  • yagmail is actively developed so updating to the most recent version could fix some issues. The exact command I issued on my Pi was ~/oprint/bin/pip-2.7 install yagmail[all] --upgrade
  • On a related note, the system pip/python environment is different from Octoprint's oprint/bin pip/python environment (at least in my case). Prior to updating, I had two versions of yagmail installed on my Pi, with a fairly old one in ~/oprint). So, be careful to prefix your pip or python setup commands with the appropriate path.

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

anoved avatar Apr 20 '17 01:04 anoved

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

yagmail.register('[email protected]', '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.

KyneSilverhide avatar Apr 20 '17 12:04 KyneSilverhide

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.

rcooklo avatar May 20 '17 18:05 rcooklo

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

SurfingSpider avatar Jun 05 '17 10:06 SurfingSpider

I followed the instructions from rcooklo and it works now.

KyneSilverhide avatar Jun 05 '17 10:06 KyneSilverhide