In general, stack init is only run once to initialize a new project. You would typically run this in an empty directory, where it will create a stack.yaml from some template.
This template stack.yaml mostly contains comments that explain you all the different options.
However, you could also manually create it, like for instance:
resolver: lts-20.16
Once you have your stack.yaml in place, there are two options:
You can either use a traditional <your-project-name>.cabal file, or write a package.yaml file. See https://github.com/sol/hpack for details on how to write such a file.
When you use stack build, and there is only a .cabal file and no package.yaml, then Stack will use that.
However, if a package.yaml exists, then Stack will automatically create and update the <your-project-name>.cabal file for you.
And prior to doing so, it will check whether that file is newer than the stack.yaml or package.yaml, to avoid possibly overwriting any manual changes in that file.
So the error message that you're getting should normally mean that someboy (ie. your teacher) manually edited the Project.cabal file although a package.yaml exists.
However, what is puzzling about it is that normally, both files should be in the project's root directory - but your error message contains a Windows-style path-name in it.
Then, there is the ever more troubling last line - about sh not found on path.
Is it possible that you are trying to run this on Windows?
I have never used Haskell on Windows myself, so I have no clue about how that should work. But an error message about the Linux / Unix command interpreter sh not being found would be typical for some Linux / Unix software that's not been fully ported to Windows yet.
I am also solely basing my "Windows suspicion" on the first line of the error message, which contains a path with a backslash in it, as it would on Windows.
But maybe my general description of the Stack build process can help shed some light on this as well.
Executable named sh not found on pathhave you tried checking ifshis in PATH?....."Path", or have you deleted part of the error? If you have deleted part of the error, please undelete it. I understand that you are trying to be helpful, and appreciate it, but I think in this specific case the full contents is better. If there is sensitive information in the real error that you'd like to hide, perhaps you could randomize that section rather than omitting it.