Open robotichead opened 2 years ago
I experienced this exact issue this morning. Your quick fix solved my problem. Thank you!
I experienced same issue today
Same here, using zappa==0.47.1
Just downgrade to troposphere==2.7.1
and it worked.
Thanks
@Anjalibhatt As said, downgrading to troposphere==2.7.1
will fix it. This is on zappa latest version.
I met the same error in zappa 0.53.0. but, I resolved.
I use pipenv
, so executed below
pipenv install zappa==0.52.0
pipenv install troposphere==2.7.1
important! zappa update dev
does not make sense.
Finally, I ran below and succeeded :>
zappa undeploy dev
zappa deploy dev
As mentioned in this stackoverflow answer,
Since version 3.0.0, the package troposphere removed the deprecated Template methods (see the 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.
The above issue can be fixed by adding troposphere<3 in the requirements file.
Is there any update on this fix? The troposphere solution was working for some time, but now troposphere<3
fails due to use_2to3
with the following error:
Running setup.py install for troposphere ... - error
ERROR: Command errored out with exit status 1:
command: /home/circleci/tmp/venv/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ex_p9mes/troposphere_eea0d5a3f8ef4e01a1e32315a1ff4d50/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ex_p9mes/troposphere_eea0d5a3f8ef4e01a1e32315a1ff4d50/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'"'"'))' install --record /tmp/pip-record-_rajpc5d/install-record.txt --single-version-externally-managed --compile --install-headers /home/circleci/tmp/venv/include/site/python3.6/troposphere
cwd: /tmp/pip-install-ex_p9mes/troposphere_eea0d5a3f8ef4e01a1e32315a1ff4d50/
Complete output (1 lines):
error in troposphere setup command: use_2to3 is invalid.
----------------------------------------
ERROR: Command errored out with exit status 1: /home/circleci/tmp/venv/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ex_p9mes/troposphere_eea0d5a3f8ef4e01a1e32315a1ff4d50/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ex_p9mes/troposphere_eea0d5a3f8ef4e01a1e32315a1ff4d50/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'"'"'))' install --record /tmp/pip-record-_rajpc5d/install-record.txt --single-version-externally-managed --compile --install-headers /home/circleci/tmp/venv/include/site/python3.6/troposphere Check the logs for full command output.
This also seems to be a consistent issue on all projects using use_2to3
due to some recent breaking changes on setuptools
https://setuptools.readthedocs.io/en/latest/history.html#breaking-changes
However the issue is now we can resolve the use_2to3
error by updating the troposphere version but then we're back to the error at the beginning of this thread.
Anyone have any advice? Also is there any update on getting the core of this issue fixed?
UPDATE
I was able to find a workaround for still using troposphere<3
by also adding setuptools==57.5.0
. So I have both the following in my requirements:
setuptools==57.5.0
troposphere<3
zappa==0.53.0
Context
Setup of a Django environment for deployment onto AWS Lambda. Had the following pip packages installed
pip install NearBeach zappa pymysql django-storages cryptography
Ran the following command
zappa update
to update my live environment.Expected Behavior
Zappa to deploy the site correctly.
Actual Behavior
Failed to deploy. With the following errors (pulled from my terminal)
Possible Fix
As discussed on the stackoverflow - https://stackoverflow.com/questions/68391621/zappa-deploy-fails-with-attributeerror-template-object-has-no-attribute-add - the error looks like it has something to do with the NEW troposphere.
Running the following command (i.e. downgrading the troposphere) worked for me:
pip install troposphere==2.7.1
Your Environment
pip freeze
: