question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to create a project - tag name expected

See original GitHub issue

🐛 Bug Report

I failed to create a project using the cookie cutter, tried several times, and got the same error:

Traceback (most recent call last):
  File "/home/peter/.local/bin/cookiecutter", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/peter/.local/lib/python3.8/site-packages/cookiecutter/cli.py", line 140, in main
    cookiecutter(
  File "/home/peter/.local/lib/python3.8/site-packages/cookiecutter/main.py", line 101, in cookiecutter
    result = generate_files(
  File "/home/peter/.local/lib/python3.8/site-packages/cookiecutter/generate.py", line 352, in generate_files
    generate_file(
  File "/home/peter/.local/lib/python3.8/site-packages/cookiecutter/generate.py", line 169, in generate_file
    tmpl = env.get_template(infile_fwd_slashes)
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 830, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 804, in _load_template
    template = self.loader.load(self, name, globals)
  File "/usr/lib/python3/dist-packages/jinja2/loaders.py", line 125, in load
    code = environment.compile(source, name, filename)
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 591, in compile
    self.handle_exception(exc_info, source_hint=source_hint)
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "./pyproject.toml", line 45, in <module>
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 497, in _parse
    return Parser(self, source, name, encode_filename(filename)).parse()
  File "/usr/lib/python3/dist-packages/jinja2/parser.py", line 901, in parse
    result = nodes.Template(self.subparse(), lineno=1)
  File "/usr/lib/python3/dist-packages/jinja2/parser.py", line 883, in subparse
    rv = self.parse_statement()
  File "/usr/lib/python3/dist-packages/jinja2/parser.py", line 125, in parse_statement
    self.fail('tag name expected', token.lineno)
  File "/usr/lib/python3/dist-packages/jinja2/parser.py", line 59, in fail
    raise exc(msg, lineno, self.name, self.filename)
jinja2.exceptions.TemplateSyntaxError: tag name expected
  File "./pyproject.toml", line 45
    {%+ if cookiecutter.create_example_template == 'cli' %}

🔬 How To Reproduce

  1. Run cookiecutter gh:TezRomacH/python-package-template --checkout v1.1.0
  2. Then select:
  3. You’ve downloaded /home/peter/.cookiecutters/python-package-template before. Is it okay to delete and re-download it? [yes]: (yes)
  4. project_name [python-project]: flac-converter
  5. project_description [Awesome flac-converter is a Python cli/package created with https://github.com/TezRomacH/python-package-template]: (default)
  6. organization [flac-converter]: pksol
  7. license: default MIT
  8. minimal_python_version: - 3.7
  9. github_name [pksol]: (default)
  10. email [hello@pksol.com]: kogan.peter@gmail.com
  11. version [0.1.0]: (default)
  12. line_length [88]: (default)
  13. create cli (default)
  14. Then the above exception happens

Environment

  • OS: Linux - Ubuntu
  • Python version: 3.8.10

📈 Expected behavior

The project is created.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pksolcommented, Nov 19, 2021

I tried to uninstall and then reinstalled cookie-cutter, got the same result.

0reactions
TezRomacHcommented, Dec 29, 2021

I’m glad it ended successfully!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flask Error extending html with template: jinja2.exceptions. ...
python - Flask Error extending html with template: jinja2. exceptions. TemplateSyntaxError: tag name expected - Stack Overflow. Stack Overflow for Teams –  ......
Read more >
"SaltRenderError: Jinja syntax error: tag name expected ...
It seems like the rendering of the file fails because there's Jinja characters in that section. If i escape the % , {...
Read more >
jinja2.exceptions.TemplateSyntaxError: tag name expected
I got this error after added all the code to the layout.html file. I still get the error even when I comment out...
Read more >
Importing XML - 'Expected Tag' Error on Project:Support desk
My import tool says "Import failed: Expected tag, got #comment." Yes, the .XML is UTF-8 and I didn't modify it.
Read more >
In Xamarin Forms Android run, what is this "error APT1000
In Xamarin Forms Android run, what is this "error APT1000: Found tag id where item is expected"? I am getting this error in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found