Installing a Python-based plugin without the Python module

If the Python module isn’t already installed (and/or selected in Glyphs Preferences > Addons), then installing my Python-based plugin is a huge hassle that seems to require many Glyphs restarts. (My plugin is installed from a file, not the plugin manager).

Perhaps because I have other versions of Python on my machine, Glyphs gives this error about PyObjC after the plugin has been installed and Glyphs restarts. This is confusing and cryptic to anyone other than a plugin developer—and the suggestion to install the Python module should at least be the primary message.

Screen Shot 2023-03-19 at 11.20.55 AM

I’m guessing/hoping that Glyphs shows a less cryptic message if the user doesn’t have any Python installation on their machine already.

I can think of 2 improvements that would make this process seamless:

  1. When the user chooses to install a Python-based plugin (it could simply check if the entrypoint is a .py file), Glyphs could show a second alert suggesting they install the Glyphs Python module—if Python and PyObjC aren’t available. Then, when Glyphs restarts, the plugin will be able to run without crashing (and suggesting that the user uninstall the plugin because it crashed—which is unhelpful in this scenario).

  2. Right after installing the Glyphs Python module, the version of Python chosen in Preferences > Addons could automatically change to the Glyphs Python version. This would solve so many moments of confusion whenever a Glyphs user installs the module but is confused by the Glyphs Python API not working because they had some other Python installation on their system already. I teach Python workshops for type designers and there’s always at least 1 person who isn’t using a compatible version of Python—so this improvement would be helpful far beyond my plugin’s user base. Installing the Glyphs Python module is a clear and explicit indication of intent to use that version of Python, so Glyphs can safely set it as the default on the user’s behalf.

Thanks for considering! Let me know what you think.

The error only comes up when the user has manually installed python (through brew or from python.org). So that suggests some level of technical literacy. Asking then to install a module with pip should be doable for them.

Everyone else will not see this dialog. They will be asked to install the Glyphs python module from the plugin manager.

In the next version, the plugin and module installation process will be a bit better (less restarting).

Automatically selecting the Glyphs python after installing it is a good idea.

Thanks, Georg! When you say “the next version” are you referring to 3.2 or 4.0?

Version 4. It required a bigger change in the underpinnings that changed a bit more than I’m comfortable doing in a dot update.