Zappa部署错误troposphere==2.7.1对AttributeError没有帮助:“模板”对象没有属性“添加描述”

2024-06-10 16:25:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经将python项目从2.7迁移到3.8。我正在尝试使用zappa进行部署。 但是,一旦开始更新Lambda函数配置,就会出现此错误

Updating Lambda function configuration..
Oh no! An error occurred! :(

==============

Traceback (most recent call last):
  File "/Users/leilakarimi/Projects/ATGWSams/venv/lib/python3.7/site-packages/zappa/cli.py", line 3422, in handle
    sys.exit(cli.handle())
  File "/Users/leilakarimi/Projects/ATGWSams/venv/lib/python3.7/site-packages/zappa/cli.py", line 588, in handle
    self.dispatch_command(self.command, stage)
  File "/Users/leilakarimi/Projects/ATGWSams/venv/lib/python3.7/site-packages/zappa/cli.py", line 644, in dispatch_command
    self.vargs["docker_image_uri"],
  File "/Users/leilakarimi/Projects/ATGWSams/venv/lib/python3.7/site-packages/zappa/cli.py", line 1194, in update
    endpoint_configuration=self.endpoint_configuration,
  File "/Users/leilakarimi/Projects/ATGWSams/venv/lib/python3.7/site-packages/zappa/core.py", line 2417, in create_stack_template
    self.cf_template.add_description("Automatically generated with Zappa")
AttributeError: 'Template' object has no attribute 'add_description'

我发现了这个问题,并试图按照本post中的建议降低对流层,但我再次面临一个新的错误,如下所示:

   ERROR: Command errored out with exit status 1:
     command: /Users/leilakarimi/Projects/ATGWSams/venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/2q/m5qvgtkj1872r4695zkbpln80000gn/T/pip-install-w9uojyvq/troposphere_527f0b9692da4c9ca1d6451190752408/setup.py'"'"'; __file__='"'"'/private/var/folders/2q/m5qvgtkj1872r4695zkbpln80000gn/T/pip-install-w9uojyvq/troposphere_527f0b9692da4c9ca1d6451190752408/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/2q/m5qvgtkj1872r4695zkbpln80000gn/T/pip-pip-egg-info-hguo5f3y
         cwd: /private/var/folders/2q/m5qvgtkj1872r4695zkbpln80000gn/T/pip-install-w9uojyvq/troposphere_527f0b9692da4c9ca1d6451190752408/
    Complete output (1 lines):
    error in troposphere setup command: use_2to3 is invalid.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/35/a1/cfb1f6b2f271213da05fd5c67cda0256d7d841ba0edbfa815ae517c6235d/troposphere-2.2.0.tar.gz#sha256=b2e322063e2278e7d69822943d230b683ce9a0438db8ad017f610d344998453d (from https://pypi.org/simple/troposphere/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement troposphere==2.7.1 (from versions: 0.1.2, 0.2.0, 0.3.0, 0.3.2, 0.3.3, 0.3.4, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.7.0, 0.7.1, 0.7.2, 1.0.0, 1.1.0, 1.1.1, 1.1.2, 1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 2.0.0, 2.0.1, 2.0.2, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 2.4.9, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.7.0, 2.7.1, 3.0.0, 3.0.1, 3.0.2, 3.0.3)
ERROR: No matching distribution found for troposphere==2.7.1

非常感谢您的任何想法/帮助。 谢谢


Tags: inpyvenvlibpackagessetupsiteusers
2条回答

我们已经分叉了zappa,并取消了Werkzeug的固定要求。Zappa项目已重新启动,但更新已晚。您可以在这个blog上阅读如何执行此操作

setuptools58中断了对use_2to3的支持。因此,您应该将setuptools<58troposphere<3一起添加到需求文件中。如果您仍然遇到相同的问题,请先降级setuptools,然后根据其他要求安装troposphere

相关问题:Error while downloading the requirements using pip install (setup command: use_2to3 is invalid.)

相关问题 更多 >