Can you paint the engine bay with the engine still installed?

Depends how nice of a job you want to do, I imagine it could be done with ok results just the more you remove from under the hood the better the results and depends on what colour your changing from and too because places you can reach is just gonna get over spray.