python安装matplotlib失败_Python / pip无法安装Matplotlib

1586010002-jmsa.png

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.

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.

Any help is greatly appreciated.

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

解决方案

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值