You’re using the terminal’s
python rather than PyCharm’s. If you want to change your default Python you’ll need to update your
$PATH variable. See this for more: how to change default python version?
If you just want to use PyCharm though, just right click on the file and click run.