Unable to Install Pyviz

In Python 3.2, the base ConfigParser class in the standard library configparser module was replaced with the SafeConfigParser implementation, so that this would be the default parser, and SafeConfigParser was made into a deprecated alias. For example, from the Python 3.8 standard library source code:

class SafeConfigParser(ConfigParser):
    """ConfigParser alias for backwards compatibility purposes."""

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        warnings.warn(
            "The SafeConfigParser class has been renamed to ConfigParser "
            "in Python 3.2. This alias will be removed in future versions."
            " Use ConfigParser directly instead.",
            DeprecationWarning, stacklevel=2
        )

Even in prehistoric times, the advice was to use SafeConfigParser by default:

So, older projects (the public release history of Matplotlib goes back to 2004, to say nothing of unreleased development versions) made that choice, and didn’t update unless and until really forced.

Now they have been forced, because the alias has been removed in 3.12, after a stronger warning in 3.11.

In this case, the call is being made by the build system (which is also written in Python). The version of pyviz that Pip selected for you believes that it can be installed on Python 3.12; and it expects a particular version of matplotlib; but that version of matplotlib can’t be built on 3.12 with your current setup. Since you have a “sdist” (source distribution) for matplotlib already stored locally, Pip tries to use that instead of looking for a Matplotlib wheel on PyPI.

3.0.3 is a fairly old version of Matplotlib - it was released way back in 2019. When it was released, it simply claimed to support Python versions 3.5 and greater - the ones currently available. As to whether the built Matplotlib wheel will actually work on 3.12 (assuming there is one for your platform!), there is no easy way to know - when they produced the wheels, 3.12 didn’t exist, so they couldn’t possibly have tested that; and they aren’t going to test it now, because they’re busy working on (checks notes) the 3.8 branch.

You can try removing the cached matplotlib-3.0.3.tar.gz (I don’t know offhand how to find the cache) and then pip install matplotlib==3.0.3 directly. If you’re lucky, there’s a wheel for your platform, and you somehow got the .tar.gz file by mistake. But most likely it just isn’t going to work (you probably have this sdist you’ve tried the installation multiple times, and Pip couldn’t find a wheel the first time).

In which case:

You probably have the right idea here.

To diagnose the new problem, we would need to know exactly what version you tried using, and see exactly what happened when you tried.

One thing to consider: the latest version of Pyviz was also released in 2019. At that time, the specified “pinned” version of Matplotlib was only a few months old. This release is documented as requiring Python 3.6 or later; and 3.8 had not been released quite yet.

So I would try to find either Python 3.6 or 3.7 to be sure, if you have to use this code. But keep in mind that 3.7 is now EOL. You might be better served by trying to find a different library that does what Pyviz is supposed to do.