Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to create "drivendataorg/cookiecutter-data-science" template in Cookiecutter. #8028

Open
ttSpace opened this issue Oct 15, 2024 · 0 comments
Assignees

Comments

@ttSpace
Copy link

ttSpace commented Oct 15, 2024

Describe the bug

Image

Steps to Reproduce

  1. Launch VS.

  2. Click "View->Cookiecutter Explorer".

  3. Select "drivendataorg/cookiecutter-data-science" from the "GitHub" section, then click "Next".

    Image

  4. Wait for load successfully and then click "Create and Open Folder".

Expected behavior

It should create successfully.

Additional context and screenshots

An error occurred while creating the template.

Image

Logs

Output for General in the Output panel


----- Cloning template 'drivendataorg/cookiecutter-data-science' -----
Cloning into 'cookiecutter-data-science'...
----- Successfully cloned template 'drivendataorg/cookiecutter-data-science' to 'C:\Users\vting\.cookiecutters\cookiecutter-data-science' -----
----- Loading template 'drivendataorg/cookiecutter-data-science' -----
{"cookiecutter": {"DEPRECATED": "Use of the `cookiecutter` command is deprecated. Please use `ccds` in place of `cookiecutter`. To continue using the deprecated template, use `cookiecutter ... -c v1`."}}
----- Successfully loaded template 'drivendataorg/cookiecutter-data-science' -----

----- Creating files using template 'drivendataorg/cookiecutter-data-science' -----
DEBUG main.py: context_file is C:\Users\vting\.cookiecutters\cookiecutter-data-science\cookiecutter.json
DEBUG generate.py: Context generated is {'cookiecutter': OrderedDict([('DEPRECATED', 'Use of the `cookiecutter` command is deprecated. Please use `ccds` in place of `cookiecutter`. To continue using the deprecated template, use `cookiecutter ... -c v1`.')])}
DEBUG utils.py: Making sure path exists: C:\Users\vting/.cookiecutter_replay/
DEBUG find.py: Searching C:\Users\vting\.cookiecutters\cookiecutter-data-science for the project template.
DEBUG find.py: The project template appears to be C:\Users\vting\.cookiecutters\cookiecutter-data-science\{{ cookiecutter.repo_name }}
DEBUG generate.py: Generating project from C:\Users\vting\.cookiecutters\cookiecutter-data-science\{{ cookiecutter.repo_name }}...
Traceback (most recent call last):
  File "C:\Users\vting\AppData\Local\Microsoft\CookiecutterTools\env\lib\site-packages\cookiecutter\generate.py", line 264, in generate_files
    project_dir = render_and_create_dir(
  File "C:\Users\vting\AppData\Local\Microsoft\CookiecutterTools\env\lib\site-packages\cookiecutter\generate.py", line 193, in render_and_create_dir
    rendered_dirname = name_tmpl.render(**context)
  File "C:\Users\vting\AppData\Local\Microsoft\CookiecutterTools\env\lib\site-packages\jinja2\environment.py", line 1304, in render
    self.environment.handle_exception()
  File "C:\Users\vting\AppData\Local\Microsoft\CookiecutterTools\env\lib\site-packages\jinja2\environment.py", line 939, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'repo_name'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\cookiecutter\cookiecutter_run.py", line 46, in <module>
    sys.exit(int(main() or 0))
  File "c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\cookiecutter\cookiecutter_run.py", line 37, in main
    cookiecutter(
  File "C:\Users\vting\AppData\Local\Microsoft\CookiecutterTools\env\lib\site-packages\cookiecutter\main.py", line 140, in cookiecutter
    return generate_files(
  File "C:\Users\vting\AppData\Local\Microsoft\CookiecutterTools\env\lib\site-packages\cookiecutter\generate.py", line 273, in generate_files
    raise UndefinedVariableInTemplate(msg, err, context)
cookiecutter.exceptions.UndefinedVariableInTemplate: Unable to create project directory '{{ cookiecutter.repo_name }}'. Error message: 'dict object' has no attribute 'repo_name'. Context: {'cookiecutter': {'DEPRECATED': 'Use of the `cookiecutter` command is deprecated. Please use `ccds` in place of `cookiecutter`. To continue using the deprecated template, use `cookiecutter ... -c v1`.'}}
C:\Users\vting\AppData\Local\Microsoft\CookiecutterTools\env\scripts\python.exe returned an exit code of 1.
----- Failed to create files using template 'drivendataorg/cookiecutter-data-science' -----

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants