Zappa 部署错误 - 对流层==2.7.1 没有帮助 AttributeError:“模板”对象没有属性“add_description”

2024-01-09

我已将 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 https://stackoverflow.com/questions/68391621/zappa-deploy-fails-with-attributeerror-template-object-has-no-attribute-add但我再次面临一个新错误,如下所示:

   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

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


setuptools58 打破了对的支持use_2to3。因此,您应该添加setuptools<58到您的需求文件以及troposphere<3。如果仍然遇到同样的问题,请先降级 setuptools,然后安装符合其他要求的对流层。

相关问题:使用 pip install 下载需求时出错(安装命令:use_2to3 无效。) https://stackoverflow.com/questions/69100275/error-while-downloading-the-requirements-using-pip-install-setup-command-use-2

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Zappa 部署错误 - 对流层==2.7.1 没有帮助 AttributeError:“模板”对象没有属性“add_description” 的相关文章

随机推荐