我正在尝试使用 pygooglevoice 包发送 SMS 消息。我按照他们网站http://sphinxdoc.github.io/pygooglevoice/index.html上的安装说明进行操作(除了我使用 pip 而不是 easy_install 安装包)。然后我设置了帐户/密码文档并使用http://sphinxdoc.github.io/pygooglevoice/examples.html#send-sms-messages上提供的以下代码发送 SMS 消息。
但是,我收到一个 TypeError,说在名为 configparser.py 的文档中有一个名为“raw”的意外参数。任何人都可以帮助解释下面的此错误消息并提出可能的解决方案吗?非常感谢!
TypeError Traceback (most recent call last)
<ipython-input-75-590efd152ee6> in <module>
3
4 voice = Voice()
----> 5 voice.login()
6
7 phoneNumber = input('4437348572')
/opt/conda/lib/python3.8/site-packages/googlevoice/voice.py in login(self, email, passwd)
58
59 if email is None:
---> 60 email = config.email
61 if email is None:
62 email = input('Email address: ')
/opt/conda/lib/python3.8/site-packages/googlevoice/conf.py in <lambda>(self)
53 phoneType = property(phoneType)
54 forwardingNumber = property(lambda self: self.get('forwardingNumber'))
---> 55 email = property(lambda self: self.get('email', 'auth'))
56 password = property(lambda self: self.get('password', 'auth'))
57 secret = property(lambda self: self.get('secret'))
/opt/conda/lib/python3.8/site-packages/googlevoice/conf.py in get(self, option, section)
33 def get(self, option, section='gvoice'):
34 try:
---> 35 return ConfigParser.get(self, section, option).strip() or None
36 except NoOptionError:
37 return
/opt/conda/lib/python3.8/configparser.py in get(self, section, option, raw, vars, fallback)
797 return value
798 else:
--> 799 return self._interpolation.before_get(self, section, option, value,
800 d)
801
/opt/conda/lib/python3.8/configparser.py in before_get(self, parser, section, option, value, defaults)
393 def before_get(self, parser, section, option, value, defaults):
394 L = []
--> 395 self._interpolate_some(parser, option, L, value, section, defaults, 1)
396 return ''.join(L)
397
/opt/conda/lib/python3.8/configparser.py in _interpolate_some(self, parser, option, accum, rest, section, map, depth)
406 def _interpolate_some(self, parser, option, accum, rest, section, map,
407 depth):
--> 408 rawval = parser.get(section, option, raw=True, fallback=rest)
409 if depth > MAX_INTERPOLATION_DEPTH:
410 raise InterpolationDepthError(option, section, rawval)
TypeError: get() got an unexpected keyword argument 'raw'```