gpt4 book ai didi

python - 无法在 Python 3.10 上安装 Matplotlib

转载 作者:行者123 更新时间:2023-12-05 00:43:30 24 4
gpt4 key购买 nike

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,因此您有以下选择。

  1. 查看 answer有关降级到 Python 3.9 的详细说明。
  2. 安装支持 Python 3.10 的 Matplotlib 预发布版本。这可以通过命令 pip install matplotlib==3.5.0rc1 来完成(我建议这样做)。

关于python - 无法在 Python 3.10 上安装 Matplotlib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69791864/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com