I have Windows 7.
For some reason, f2tfont.cpp does not compile when installing matplotlib (through pip
), hence, the matplotlib install fails. Also, the
As specified in PEP 11, a Python release only supports a Windows platform while Microsoft considers the platform under extended support. This means that Python 3.7 supports Windows Vista and newer. If you require Windows XP support then please install Python 3.4.
In case Windows Service Pack isn't installed. You can download Windows 7 Service Pack 1 (SP1) manually from here or also you can download it from Windows Update of Windows 7.
So, you need to install Microsoft Visual C++ redistribution 2015 from here.
You don't need to install Microsoft Visual Studio just C++ redistributions of 2015 will do the job.
None of above solutions worked for me! Try this:
pip uninstall matplotlib
pip install -U matplotlib==3.2.0rc1
If you get this error by just importing matplotlib, you probably have a botched matplotlib installation. Did you compile it yourself (which I find very hard to do) or did you use a binary installer from the official page (which works like a charm, as long as you installed the dependencies beforehand)?
DO NOT USE pip
for installing matplotlib and numpy, but use it for all other dependencies. This may change in the future as soon as wheels arecoming out for matplotlib.
Python console output on a Windows box:
>>> matplotlib.__version__
'1.3.1'
>>> from matplotlib import ft2font
>>>
I had this issue and then uninstalled and reinstalled conda, and updated all packages through conda. But the issue persisted. I then did a conda uninstall of the offending package (in my case, this error appeared for both matplotlib and h5py), and then pip installed them. This seemed to have fixed the issue. Strangely, it would only give this error through the console. When run through a Jupyter notebook, I didn't see this error. Must be some difference between IPython and python.
You need to have Visual Studio c++ in Your System.
Install Visual Studio 2019 with c++ distributions .
It worked perfectly for me.
This worked for me on Windows 10 (using the Anaconda prompt):
pip uninstall matplotlib
pip install --upgrade matplotlib