Zappa deploy fails with AttributeError: 'Template' object has no attribute 'add_description'
Zappa deploy fails with AttributeError: 'Template' object has no attribute 'add_description'
几天前,zappa deploy
失败并出现以下错误(zappa 版本 0.50.0):
Traceback (most recent call last):
File "/root/repo/venv/lib/python3.6/site-packages/zappa/cli.py", line 2785, in handle
sys.exit(cli.handle())
File "/root/repo/venv/lib/python3.6/site-packages/zappa/cli.py", line 510, in handle
self.dispatch_command(self.command, stage)
File "/root/repo/venv/lib/python3.6/site-packages/zappa/cli.py", line 557, in dispatch_command
self.update(self.vargs['zip'], self.vargs['no_upload'])
File "/root/repo/venv/lib/python3.6/site-packages/zappa/cli.py", line 993, in update
endpoint_configuration=self.endpoint_configuration
File "/root/repo/venv/lib/python3.6/site-packages/zappa/core.py", line 2106, in create_stack_template
self.cf_template.add_description('Automatically generated with Zappa')
AttributeError: 'Template' object has no attribute 'add_description'
自版本 3.0.0
起,包 troposphere
删除了已弃用的 Template
方法(请参阅 changelog)。
Breaking changes: * Python 3.6+ (Python 2.x and earlier Python 3.x support is now deprecated due to Python EOL) * Remove previously deprecated Template methods.
可以通过在需求文件中添加 troposphere<3
来解决上述问题。
nbeuchat 的答案可能并不适用于所有人,另一种可能有用的解决方案是更改 venv/lib/python3.6{或 7,8 等}/site-packages/zappa/core 中的行。 py 从 add_description() 到 set_description().
Troposphere 已将 add_description 更新为 set_description 以及其他先前弃用的模板方法,这就是您看到此问题的原因。
几天前,zappa deploy
失败并出现以下错误(zappa 版本 0.50.0):
Traceback (most recent call last):
File "/root/repo/venv/lib/python3.6/site-packages/zappa/cli.py", line 2785, in handle
sys.exit(cli.handle())
File "/root/repo/venv/lib/python3.6/site-packages/zappa/cli.py", line 510, in handle
self.dispatch_command(self.command, stage)
File "/root/repo/venv/lib/python3.6/site-packages/zappa/cli.py", line 557, in dispatch_command
self.update(self.vargs['zip'], self.vargs['no_upload'])
File "/root/repo/venv/lib/python3.6/site-packages/zappa/cli.py", line 993, in update
endpoint_configuration=self.endpoint_configuration
File "/root/repo/venv/lib/python3.6/site-packages/zappa/core.py", line 2106, in create_stack_template
self.cf_template.add_description('Automatically generated with Zappa')
AttributeError: 'Template' object has no attribute 'add_description'
自版本 3.0.0
起,包 troposphere
删除了已弃用的 Template
方法(请参阅 changelog)。
Breaking changes: * Python 3.6+ (Python 2.x and earlier Python 3.x support is now deprecated due to Python EOL) * Remove previously deprecated Template methods.
可以通过在需求文件中添加 troposphere<3
来解决上述问题。
nbeuchat 的答案可能并不适用于所有人,另一种可能有用的解决方案是更改 venv/lib/python3.6{或 7,8 等}/site-packages/zappa/core 中的行。 py 从 add_description() 到 set_description().
Troposphere 已将 add_description 更新为 set_description 以及其他先前弃用的模板方法,这就是您看到此问题的原因。