简体   繁体   English

无法安装 matplotlib:致命错误 C1083:无法打开包含文件:'ft2build.h':没有这样的文件或目录

[英]Can't install matplotlib : fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory

I'm trying to install the matplotlib module but when I try to do so I get an error, that being pretty big but it seems to be due to a missing file, ft2build.h我正在尝试安装 matplotlib 模块,但是当我尝试这样做时,我收到一个错误,它非常大,但似乎是由于缺少文件 ft2build.h

What can I do to fix this?我能做些什么来解决这个问题?

Here is the error code I get (I've had to remove part of the error message as it was too big, I removed the part where files were copied and some created):这是我得到的错误代码(我不得不删除部分错误消息,因为它太大了,我删除了复制文件并创建了一些文件的部分):

ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Maca\AppData\Local\Programs\Python\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Maca\\AppData\\Local\\Temp\\pip-install-8fraia6a\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Maca\\AppData\\Local\\Temp\\pip-install-8fraia6a\\matplotlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Maca\AppData\Local\Temp\pip-record-1miy2gd_\install-record.txt' --single-version-externally-managed --compile
         cwd: C:\Users\Maca\AppData\Local\Temp\pip-install-8fraia6a\matplotlib\
    Complete output (505 lines):
    ================================================================================
    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
      matplotlib: yes [3.1.1]
          python: yes [3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC
                      v.1916 32 bit (Intel)]]
        platform: yes [win32]

    OPTIONAL SUBPACKAGES
     sample_data: yes [installing]
           tests: no  [skipping due to configuration]

    OPTIONAL BACKEND EXTENSIONS
             agg: yes [installing]
           tkagg: yes [installing; run-time loading from Python Tcl/Tk]
          macosx: no  [Mac OS-X only]

    OPTIONAL PACKAGE DATA
            dlls: no  [skipping due to configuration]


    UPDATING build\lib.win32-3.8\matplotlib\_version.py
    set build\lib.win32-3.8\matplotlib\_version.py to '3.1.1'
    running build_ext
    building 'matplotlib.ft2font' extension
    creating build\temp.win32-3.8
    creating build\temp.win32-3.8\Release
    creating build\temp.win32-3.8\Release\src
    D:\Program Files\Microsoft Visual Studio\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DFREETYPE_BUILD_TYPE=system -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -Iextern/agg24-svn/include -IC:\Users\Maca\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numpy\core\include -IC:\Users\Maca\AppData\Local\Programs\Python\Python38-32\include -IC:\Users\Maca\AppData\Local\Programs\Python\Python38-32\include "-ID:\Program Files\Microsoft Visual Studio\VC\Tools\MSVC\14.15.26726\ATLMFC\include" "-ID:\Program Files\Microsoft Visual Studio\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcsrc/checkdep_freetype2.c /Fobuild\temp.win32-3.8\Release\src/checkdep_freetype2.obj
    checkdep_freetype2.c
    src/checkdep_freetype2.c(1): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory
    error: command 'D:\\Program Files\\Microsoft Visual Studio\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Maca\AppData\Local\Programs\Python\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Maca\\AppData\\Local\\Temp\\pip-install-8fraia6a\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Maca\\AppData\\Local\\Temp\\pip-install-8fraia6a\\matplotlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Maca\AppData\Local\Temp\pip-record-1miy2gd_\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

Download your file to a folder on your C drive.将文件下载到 C 驱动器上的文件夹中。 In windows CMD prompt as Administrator navigate you your path using cd.. or cd wheels (in my case I saved the file to c:\Wheels) then type pip install YourFilename.whl In windows CMD prompt as Administrator navigate you your path using cd.. or cd wheels (in my case I saved the file to c:\Wheels) then type pip install YourFilename.whl

At the time the version of python I installed was quite new, therefore didnt quite have the support for the module at this point.当时我安装的python的版本比较新,所以目前对模块还不太支持。 As pointed out by Talha Junaid.正如 Talha Junaid 指出的那样。 I have also encountered a similar issue with multiple other modules from time to time, though not necessarily in this form of error.我也时常遇到与其他多个模块类似的问题,尽管不一定是这种形式的错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Matplotlib 构建问题:错误 C1083:无法打开包含文件:'ft2build.h' - Matplotlib Build Problem: Error C1083: Cannot open include file: 'ft2build.h' 无法安装mysql客户端1.3.12出现致命错误C1083:无法打开包含文件:mysql.h:无此类文件或目录 - Unable to install mysql client 1.3.12 getting fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory Could not install pycocotools in windows: fatal error C1083: Cannot open include file: 'io.h': No such file or directory 错误: - Could not install pycocotools in windows: fatal error C1083: Cannot open include file: 'io.h': No such file or directory error: 致命错误C1083:无法打开包含文件:'openssl / opensslv.h':没有这样的文件或目录 - fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory 致命错误 C1083:无法打开包含文件:'dlfcn.h':没有这样的文件或目录 PyLPSolve - fatal error C1083: Cannot open include file: 'dlfcn.h': No such file or directory PyLPSolve Python pip install kivy致命错误C1083:无法打开包含文件:'GL / glew.h':没有这样的文件或目录 - Python pip install kivy fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory 致命错误 C1083:无法打开包含文件:“mecab.h”:没有这样的文件或目录 - fatal error C1083: Cannot open include file: 'mecab.h': No such file or directory 致命错误 C1083:无法打开包含文件:'io.h':没有这样的文件或目录 - fatal error C1083: Cannot open include file: 'io.h': No such file or directory 在 Windows 上安装 Matplotlib 错误 - 无法打开包含文件 'ft2build.h' - Installing Matplotlib on Windows ERROR - cannot open include file 'ft2build.h' snappy/snappymodule.cc(31): 致命错误 C1083: 无法打开包含文件: 'snappy-c.h': 没有那个文件或目录 - snappy/snappymodule.cc(31): fatal error C1083: Cannot open include file: 'snappy-c.h': No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM