cloudformation-cli
cloudformation-cli copied to clipboard
cfn-init causes error "The 'rpdk.core.project' package was not installed in a way that PackageLoader understands"
Hi, I am trying to run cfn init to create my new resource and I keep getting the following error
=== Unhandled exception ===
Please report this issue to the team.
Issue tracker: github.com/aws-cloudformation/cloudformation-cli/issues
Please include the log file 'rpdk.log'
rpdk.log:
[2021-05-19T00:22:27Z] DEBUG - Logging set up successfully
[2021-05-19T00:22:27Z] DEBUG - Running None: Namespace(artifact_type=None, command=<function init at 0x1206c3830>, force=False, subparser_name=None, type_name=None, verbose=0, version=False)
[2021-05-19T00:22:27Z] DEBUG - Unhandled exception
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/rpdk/core/cli.py", line 100, in main
args.command(args)
File "/usr/local/lib/python3.7/site-packages/rpdk/core/init.py", line 151, in wrapper
function(args)
File "/usr/local/lib/python3.7/site-packages/rpdk/core/init.py", line 130, in init
project = Project(args.force)
File "/usr/local/lib/python3.7/site-packages/rpdk/core/project.py", line 142, in __init__
loader=PackageLoader(__name__, "templates/"),
File "/usr/local/lib/python3.7/site-packages/jinja2/loaders.py", line 310, in __init__
f"The {package_name!r} package was not installed in a"
ValueError: The 'rpdk.core.project' package was not installed in a way that PackageLoader understands.
I saw some issue called out here which the solution did not help me https://github.com/aws-cloudformation/cloudformation-cli/issues/758#issuecomment-841344266
Could you please offer some assistance for what is wrong?
Which version of Jinja2
do you have in your Python environment?
pip freeze | grep -i 'jinja'
Jinja2==2.11.3