Apparent incompatibility between python 3.11.3 & matplotlib 3.7.1

Newish to python & matplotlib, 40 years of programming experience on multiple platforms, multiple languages - humbled by this. Have successfully used Python 3.9 & matplotlib at this version on my Windows 11 desktop for several months; installed both on my Windows 10 laptop. No pip errors when installing matplotlib. Attached image is a snip of response when attempting to import matplotlib in a script::

That error is in kiwisolver, one of our dependencies, not Matplotlib.

It looks like kiwisolver does have wheels for py311 on windows and we have not had many reports like this which makes me suspect that this is a local installation issue.

I would try re-installing kiwisolver.

If possible I strongly suggest using venv — Creation of virtual environments — Python 3.11.4 documentation so that if installations go sideways you can remove them and try again with minimal fallout.

If it is still not working and your workflow will support it I also strongly suggest moving to use conda or one of the other complete Python distributions.

Thanks for the suggestions - have started looking at venv/Anaconda for future use.

Root of my problem, though, ended up being a missing Microsoft Visual C++ 2015 redistributable on my laptop; I had the x86 package but not the x64 package. Downloading the x64 package removed the behavior (can now import Matplotlib). FWIW, in my shallow research this redistributable did not show up as a requirement, although I recall that it did install on my desktop when I initially installed Python 3.9 some months ago.

Thanks again.

···

On Fri, Jun 9, 2023 at 3:11 PM tacaswell via Matplotlib <nobody@discourse.matplotlib.org> wrote:

tacaswell
June 9 |

  • | - |

It looks like kiwisolver does have wheels for py311 on windows and we have not had many reports like this which makes me suspect that this is a local installation issue.

I would try re-installing kiwisolver.

If possible I strongly suggest using venv — Creation of virtual environments — Python 3.11.4 documentation so that if installations go sideways you can remove them and try again with minimal fallout.

If it is still not working and your workflow will support it I also strongly suggest moving to use conda or one of the other complete Python distributions.


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

Ah, that is something that the kiwisolver wheel includes when it is built.

From:

https://matplotlib.org/devdocs/users/installing/index.html#installing-from-source

For those using Visual Studio, make sure “Desktop development with C++” is selected, and that the latest MSVC, “C++ CMake tools for Windows,” and a Windows SDK compatible with your version of Windows are selected and installed. They should be selected by default under the “Optional” subheading, but are required to build matplotlib from source.

I think that this paragraph is trying to say you need the Microsoft Visual C++ 2015 redistributable, but possible without the correct terms.

Thanks. I believe I did the installation on the two systems the same way so unclear how I got different results, but the problem has resolved completely. Thanks for your interest.