Python/pip无法安装Matplotlib [英] Python/pip failed installing Matplotlib

查看:427
本文介绍了Python/pip无法安装Matplotlib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Python 3.8,能够完美安装numpy和scipy.当我尝试安装matplotlib时,我会在命令提示符下获得此输出.

I have Python 3.8 installed, I was able to install numpy and scipy flawlessly. When I try to install matplotlib I get this output in my command prompt.

    building 'matplotlib.ft2font' extension
    creating build\temp.win-amd64-3.8
    creating build\temp.win-amd64-3.8\Release
    creating build\temp.win-amd64-3.8\Release\src
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\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:\Python38\lib\site-packages\numpy\core\include -IC:\Python38\include -IC:\Python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc/checkdep_freetype2.c /Fobuild\temp.win-amd64-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 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\duket\\AppData\\Local\\Temp\\pip-install-6otudvqg\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\duket\\AppData\\Local\\Temp\\pip-install-6otudvqg\\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\duket\AppData\Local\Temp\pip-record-2fr17_ng\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

我不知道如何解决此问题,我已经更新了pip,并且我也尝试从.whl文件进行安装,但仍然没有骰子.

I have no idea how to fix this, I've updated pip and I have also tried to install from a .whl file but still no dice.

非常感谢您的帮助.

如果要完整的命令提示符输出,我在这里用它制作了一个pastebin: https://pastebin.com /HNXcGrDH

If you want the full command prompt output I made a pastebin with it here: https://pastebin.com/HNXcGrDH

推荐答案

从Gohlke教授下载预构建的lib并使用pip安装

Download the prebuilt lib from Prof. Gohlke and install using pip

https://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib

pip install matplotlib-3.1.1-cp38-cp38-win_amd64.whl

这篇关于Python/pip无法安装Matplotlib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆