from matplotlib import ft2font: “ImportError: DLL load failed: The specified procedure could not be found.”

前端 未结 10 2132
慢半拍i
慢半拍i 2020-11-30 10:13

I have Windows 7.

For some reason, f2tfont.cpp does not compile when installing matplotlib (through pip), hence, the matplotlib install fails. Also, the

相关标签:
10条回答
  • 2020-11-30 10:57

    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.

    1. For Python 3.6+ you need to have Windows Service Pack 1 installed.

    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.

    1. Python needs the Microsoft C runtime for Visual Studio 2015, especially the file ucrtbase.dll.

    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.

    0 讨论(0)
  • 2020-11-30 10:57

    None of above solutions worked for me! Try this:

    pip uninstall matplotlib
    pip install -U matplotlib==3.2.0rc1
    
    0 讨论(0)
  • 2020-11-30 10:58

    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
    >>>
    
    0 讨论(0)
  • 2020-11-30 11:00

    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.

    0 讨论(0)
  • 2020-11-30 11:01

    You need to have Visual Studio c++ in Your System.

    Install Visual Studio 2019 with c++ distributions .

    It worked perfectly for me.

    0 讨论(0)
  • 2020-11-30 11:02

    This worked for me on Windows 10 (using the Anaconda prompt):

    pip uninstall matplotlib
    pip install --upgrade matplotlib
    
    0 讨论(0)
提交回复
热议问题