python3.10 -m pip install --user matplotlib
当我运行上面的命令来安装 Matplotlib 时,我不断收到以下错误。我最初遇到 C++ 错误,然后我安装了 Visual Studio。
Time Elapsed 00:00:00.36
error: command 'C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1:
'C:\Users\HP\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-zq_i4lrq\\matplotlib_ce44358747c74e83a93eefbdd122f13e\\setup.py'"'"'; __file__='"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-zq_i4lrq\\matplotlib_ce44358747c74e83a93eefbdd122f13e\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\HP\AppData\Local\Temp\pip-record-yvrkad5m\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\HP\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Include\matplotlib'
Check the logs for full command output.
Matplotlib 目前不支持 Python 3.10,因此您有以下选择。
- 看到这个answer https://stackoverflow.com/a/69609564/7758804有关降级到 Python 3.9 的详细说明。
- 安装支持 Python 3.10 的 Matplotlib 预发行版本。这可以通过命令来完成
pip install matplotlib==3.5.0rc1
(这也是我建议做的)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)