The terminal was using python 3.9 and idle shell was using 3.11, after reinstalling 3.11 it works as I wanted it to in the first place.
In the terminal I just did python3 -V and this showed what version the terminal was using and I compared that against idle shell