Instead of using the Terminal, open the Plugin Manger (Window → Plugin Manager), switch to the Modules section and install Python. Once Python is downloaded, relaunch Glyphs to complete the installation. Now go to the Addons preferences (Glyphs → Preferences… → Addons and select the Python version ending in “(Glyphs)”. Relaunch Glyphs again for the new Python version to be used.