Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't store password #27

Open
mdiorio opened this issue Mar 9, 2017 · 8 comments
Open

Can't store password #27

mdiorio opened this issue Mar 9, 2017 · 8 comments

Comments

@mdiorio
Copy link

mdiorio commented Mar 9, 2017

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
Copy link

madmax2 commented Mar 12, 2017

Also get same problem

@HugoTheBoss
Copy link

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
Copy link

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
Copy link
Owner

anoved commented Apr 20, 2017

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.)

@KyneSilverhide
Copy link

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.

@rcooklo
Copy link

rcooklo commented May 20, 2017

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
Copy link

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
Copy link

I followed the instructions from rcooklo and it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants