使用pip安装matplotlib时出现问题



在Visual Studio代码中使用命令pip install matplotlib安装matplotlib时遇到一些错误。这是一个错误状态

Running setup.py install for matplotlib ... error
ERROR: Command errored out with exit status 1:
command: 'c:userslenovoappdatalocalprogramspythonpython39python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Lenovo\AppData\Local\Temp\pip-install-ebe54zpw\matplotlib\setup.py'"'"'; __file__='"'"'C:\Users\Lenovo\AppData\Local\Temp\pip-install-ebe54zpw\matplotlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersLenovoAppDataLocalTemppip-record-r6a9f5rhinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:userslenovoappdatalocalprogramspythonpython39Includematplotlib'
cwd: C:UsersLenovoAppDataLocalTemppip-install-ebe54zpwmatplotlib
.
.
.
UPDATING buildlib.win32-3.9matplotlib_version.py
set buildlib.win32-3.9matplotlib_version.py to '3.3.2'
running build_ext
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
Extracting freetype-2.6.1.tar.gz
Building freetype in buildfreetype-2.6.1
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:userslenovoappdatalocalprogramspythonpython39python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Lenovo\AppData\Local\Temp\pip-install-ebe54zpw\matplotlib\setup.py'"'"'; __file__='"'"'C:\Users\Lenovo\AppData\Local\Temp\pip-install-ebe54zpw\matplotlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersLenovoAppDataLocalTemppip-record-r6a9f5rhinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:userslenovoappdatalocalprogramspythonpython39Includematplotlib' Check the logs for full command output.

希望能得到解决方案,谢谢你。

如您所见;

error: Microsoft Visual C++ 14.0 is required

这是你的问题。

最新更新