The same problem exists with the original code, but here's a demo with slightly newer code.
If from_shell=True, everything works fine. If from_shell=False, then you can see another application is started, and then you see the numbers from 0 to 19 printed, but you do not see the colorsphere.
Moving these two lines out of the if statement makes no apparent difference.