A Fix for Pysolfc on Linux Mint 21 Vanessa

There are problems playing the pysolfc solitaire game on the latest release of Linux Mint 21 (Vanessa).

The game requires the formatter module from the Python Standard Library, which had been deprecated since Python 3.4, and has been removed in Python 3.10.

An easy, but ad-hoc workaround goes as follows:

  1. Download a source distribution of an earlier release of Python that still includes the module, such as Python 3.9.

  2. Extract the required file to a directory of your choice:

    tar -axOf Python-3.9.14.tgz Python-3.9.14/Lib/formatter.py > ~/lib/formatter.py
    
  1. Set your PYTHONPATH to include this directory. In t/csh:

    setenv PYTHONPATH "$PYTHONPATH":~/lib
    

This assumes that PYTHONPATH already exists; if not: setenv PYTHONPATH ~/lib.

The pysolfc team has a permanent solution in its latest release, but until that propagates to the distributions, the steps above provide an easy and relatively clean workaround.