-
Notifications
You must be signed in to change notification settings - Fork 916
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
0.19.1 kedro new
failes to create new project. Raises KedroCliError: Failed to generate project when running cookiecutter
#3539
Comments
Hi, thanks for reporting the issue should be resolved in |
This was fixed in 0.19.2 (confirmed by another user), I'm closing @BrianCechmanek but if an upgrade still doesn't do the trick please leave a comment and we'll reconsider. |
Thanks for looking into it! Unfortunately, the problem persists in 0.19.2 , both after direct upgrade (from 0.19.1) and with a fresh conda env. Same error as above. |
Hi @BrianCechmanek , sorry the problem is still there. Can you confirm the traceback looks the same? |
@BrianCechmanek Can you try
|
Thanks @noklam , @astrojuanlu I can confirm it's the same problem (trace below). I'm trying it in an empty directory. my venv (
|
I cannot reproduce on macOS on Python 3.11 (both my old Kedro installation and a newly created environment) but I can reproduce on Python 3.12 (which is nonetheless not supported yet). @BrianCechmanek could you paste the output of |
Another user reproduced this on Python 3.12 on Windows. |
I'm not using python
and lastly,
|
For readers: this consistently fails on Python 3.12 unless the
So in your case @BrianCechmanek it must be something else. We're looking into it but unfortunately we haven't been able to reproduce the issue on our end yet, and the diagnostics information from cookiecutter is not great. |
That shows a different error, at least on macOS:
|
Thanks @astrojuanlu I'll have time in a day or two to debug it a bit more. I'll see if it's more one of Conda, Windows, Cookiecutter. |
@BrianCechmanek when you get to it, one thing you can try is launching
and set a breakpoint right before
when you get to that point (notice that it's called a few times before the problematic one), you can see what's |
Tiny update:
|
@BrianCechmanek yes, that's expected.
and you should observe the error that's crashing |
Thanks for guiding me along this. Summary: I think the issue is cookiecutter trying to call a python exe that doesn't exist
Looking in my conda env folder...
No Finally, running the intermediate script via call to python:
executes without error and my project dir is seemingly correct:
I tried running kedro=0.18.14, with similar breakpoints along |
The plot thickens 😬 Disregard the So, the interesting thing then is that running the script manually seems to work, but If you want to keep digging, my recommendation is to try to set up some manual breakpoints in the cookiecutter code. This is how cookiecutter runs the script:
subprocess.Popen([sys.executable, script_path], shell=run_thru_shell, cwd=cwd) manually and see what happens. |
I can confirm that I am facing a similar issue on Edit: Fun fact: it works if I always press enter without writing anything on each entry. |
(I'm not sure if the steps I took were the right thing to do here. but I tried...)
Thanks @Galileo-Galilei -- sorta nice to know it's not just me! |
(sorry for the billion updates. really trying to get this resolved)
and it succeeds (as best I can tell).
A lot of dead ends looking at other things...
Summary: I think this goes to cookiecutter, not Kedro. Thoughts @astrojuanlu ? |
As far as anyone can tell, While I'm not saying this is the right thing to do (who can say for certain? every time I interact with CPython ...which they did! cookiecutter/cookiecutter#1394 but this seems to apply to MinGW and PowerShell. From looking at your tracebacks I don't think that's the case, but I could be wrong. And regardless, there's not enough info in the upstream issue to be sure. But maybe we're onto something?
Last suggestion: kedro/kedro/framework/cli/starters.py Line 895 in a14b6fa
You can try to run the corresponding command from your terminal. For example
And you'll likely observe an unhelpful traceback. This is something that can be reported upstream - sure, the problem might lie in the template we provide, but if the error message doesn't help users diagnose what's going on, I argue this is indeed cookiecutter's fault.
That's intriguing. If you have more info or a reproducer, please let us know. |
Finally, I think so!
So. When I've been calling I'll fix that (my cmd.exe) when I'm able and confirm back here. But, in the meantime, I'll close this bug now. So sorry to litter up your Issue board with what is ultimately not looking like a Kedro bug at all. Thank you so much for your persistence on this. What a wild ride. |
So happy we got to the bottom of this! And no need to apologize @BrianCechmanek, I know how annoying these rabbit holes can get and glad that I could help you debug this nasty issue. Maybe as a tribute do you want to send a PR to cookiecutter to amend this clunky setting? 😄 |
Description
Creating a new kedro project via
kedro new --name my_project --verbose
fails with the following error:kedro.framework.cli.utils.KedroCliError: Failed to generate project when running cookiecutter.
(full trace below)Context
kedro==0.19.1
. I have no other environments (exceptbase
which has only defaults installed), and no other kedro installs.2.5.0
(installs with kedro)Issue reproduces on
kedro==0.19.0
. Issue is absent on `kedro==0.18.14.Steps to Reproduce
Expected Result
A base new project should be created.
Actual Result
Project setup fails in Cookiecutter afaict.
Your Environment
pip show kedro
orkedro -V
):0.19.1
,0.19.0
python -V
):3.11.7
,3.10.13
The text was updated successfully, but these errors were encountered: