0

When running this command locally on mac, this works fine. However when running the same command on amazon linux, i get this issue:

command:

cookiecutter -f -v --no-input --config-file config.yaml https://bitbucket.org/project/cookiecutter-template.git --checkout master

config.yaml contents:

default_context:
    module_name: "tf-test"
    module_description: "This module provides resources for the tf-test service in AWS"
    release_date: "2022-06-07"
    terraform_version: "0.11.14"
    owner_email: "project@work.co.uk"
    precommit_version: "0.1.0"

Error code:

DEBUG cookiecutter.config: Loading custom config from config.yaml.
DEBUG cookiecutter.config: config_path is config.yaml
DEBUG cookiecutter.utils: Making sure path exists: /root/.cookiecutters/
DEBUG cookiecutter.vcs: repo_dir is /root/.cookiecutters/cookiecutter-template
DEBUG cookiecutter.main: context_file is /root/.cookiecutters/cookiecutter-template/cookiecutter.json
DEBUG cookiecutter.generate: Context generated is OrderedDict([(u'cookiecutter', OrderedDict([(u'name', u'component-example'), (u'description', u'env-component cookiecutter example'), (u'owner_name', u''), (u'terraform_version', u'0.11.14'), (u'owner_email', u'project@work.co.uk'), (u'precommit_version', u'0.1.0'), (u'jenkins_library', u'poc'), (u'jenkins_library_version', u'master')]))])
Unable to load extension: No module named html.entities
TheWalkingMalteser
  • 561
  • 1
  • 9
  • 25
  • 1
    1. try `pip install htmlentities`, 2. what version of python installed? probably you have to update python version (cookiecutter needs 3.7 and upper). 3. The newer Amazon Linux is [`Amazon Linux 2022`](https://endoflife.date/amazon-linux) (successor to Amazon Linux 2). Check if you used proper image (`Amazon Linux AMI` is outdated image with old packages on board) – rzlvmp Jul 07 '22 at 14:39

1 Answers1

0

This fixed it for me

source ~/.bash_profile
export PATH="~/.local/bin:$PATH"
python3 -m pip install "cookiecutter==2.1.1"

I was originally doing this:

pip install --user cookiecutter
TheWalkingMalteser
  • 561
  • 1
  • 9
  • 25