# python


02/05/2024, 8:55 PM
Hello, I am running into a "ModuleNotFoundError" issue strictly when customizing the main setting (entrypoint) of the Pulumi.yaml file. The code works fine when I let it use the default file, but if I change it to a custom file, it throws the error and no combination of files makes any difference. Any ideas or thoughts?


02/05/2024, 9:49 PM
Is this from setting "main" in the Pulumi.yaml? The filename from that value is what's passed as an arg to "python3", if it doesn't point to a file then we run "python3 .". That difference of "." or a file does change pythons module loader a bit though iirc. There's an issue about this with some thoughts on direction to fix this at


02/06/2024, 12:10 AM
Yes, all I'm really trying to do is to use a different name than _ (say for my entrypoint file by setting "main:" in the Pulumi.yaml file, with both those files at the root of the project and then some nested components. What's weird is that it "works" if I do something like "python3", meaning that python is able to resolve the modules for the nested components that are being imported inside That makes me think that this is not a python issue per se, since python is able to load and it's imports correctly when used directly, but it sounds like somehow things change when pulumi is the one calling python. And thanks for the link to the issue. The original repro in that issue is much more complicated than what I'm looking for, but it sounds like there could be some root problem, so I'll add a comment with my own repro and see if get's some traction.