问题
I am trying to use http://sphinxdoc.github.io/pygooglevoice/examples.html#send-sms-messages and I am getting the error
File "build/bdist.macosx-10.6-intel/egg/googlevoice/voice.py", line 72, in login
AttributeError: 'NoneType' object has no attribute 'group'
My code is:
from googlevoice import Voice
from googlevoice.util import input
import sys
username, password = "email@gmail.com", "password"
voice = Voice()
voice.login(username, password)
phoneNumber = input('Number to send message to: ')
text = input('Message text: ')
voice.send_sms(phoneNumber, text)
I was wondering if that is a login error or error in the code? If so, how can I edit the code so that it works?
Thank you so much!
EDIT: I have been researching this and apparently it's a common problem and I have to change line 72 in the file voice.py but I can't find the file:
/usr/local/lib/python2.7/dist-packages/googlevoice/voice.py
To install, I did:
$ pip install python python-setuptools
$ sudo easy_install simplejson
$ sudo easy_install -U pygooglevoice
And now I can't find the voice.py file. I have been looking for a while on my mac but found nothing.
Other questions with the same problem: https://code.google.com/archive/p/pygooglevoice/issues/76 googlevoice will not programatically login (Python) python: pygooglevoice unable to login
Please please please help!
回答1:
After struggling through errors and replacing the one line (which never worked...) I downloaded https://github.com/pettazz/pygooglevoice and put the googlevoice file in the same file I was working on. Hope this helps anyone with the same question.
来源:https://stackoverflow.com/questions/45746413/python-google-voice