Python package compatible with Python 3.6.8

I need to import matlibplot.pyplot as plt but we are having trouble getting this work with the current Python version (Python3.6.8). Do we need a different Python version?

Upgrading Python is recommended, quick and surprisingly painless from an official python.org installer.

But if you have to support an old version, it’s not a problem if you use a version of matplotlib that supports your version of Python.

Centos 8 by any chance?

You can look for mathplot as an rpm you can install.

In think centos 8 has newer versions of python packaged you can install.

I am not near a centos 8 to check this out with,

Python 3.6 and 3.7 are end-of-life now.

If you are using the Python that came with your OS, it may have been deliberately set up to prevent installing packages with Pip. In this case, you should either use your system’s package manager to install packages that were approved for use; install a new Python; or make a virtual environment (which will automatically have its own Pip bootstrapped in).

If for some reason you can’t install an up-to-date Python, you will need to find an older version of Matplotlib that is compatible with the Python version (and you will be stuck with whatever limitations that implies).

Unfortunately, there is not an easy, general way to check this sort of information (i.e. which versions of a library work on what versions of Python) unless the library authors document it, and I couldn’t easily find that. However, by going through old branches in the repository and looking at the pyproject.toml and setup.py files, I could figure out that the 3.3.x Matplotlib branch is the last one that supports Python 3.6.x.

You can specify a library version in the Pip command line, like python -m pip install matplotlib~=3.3.