C:\Users\张豪>pip install matplotlib-3.7.2-cp310-cp310-win32.whl Processing c:\users\张豪\matplotlib-3.7.2-cp310-cp310-win32.whl Collecting contourpy>=1.0.1 (from matplotlib==3.7.2) Using cached contourpy-1.1.0.tar.gz (13.4 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [12 lines of output] + meson setup C:\Users\张豪\AppData\Local\Temp\pip-install-9aonnup5\contourpy_cf94fc4320674b1ab97a527e0a04f957 C:\Users\张豪\AppData\Local\Temp\pip-install-9aonnup5\contourpy_cf94fc4320674b1ab97a527e0a04f957\.mesonpy-k9vixjo_\build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --vsenv --native-file=C:\Users\张豪\AppData\Local\Temp\pip-install-9aonnup5\contourpy_cf94fc4320674b1ab97a527e0a04f957\.mesonpy-k9vixjo_\build\meson-python-native-file.ini The Meson build system Version: 1.2.0 Source dir: C:\Users\张豪\AppData\Local\Temp\pip-install-9aonnup5\contourpy_cf94fc4320674b1ab97a527e0a04f957 Build dir: C:\Users\张豪\AppData\Local\Temp\pip-install-9aonnup5\contourpy_cf94fc4320674b1ab97a527e0a04f957\.mesonpy-k9vixjo_\build Build type: native build Project name: contourpy Project version: 1.1.0 ..\..\meson.build:1:0: ERROR: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe A full log can be found at C:\Users\张豪\AppData\Local\Temp\pip-install-9aonnup5\contourpy_cf94fc4320674b1ab97a527e0a04f957\.mesonpy-k9vixjo_\build\meson-logs\meson-log.txt [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
时间: 2023-08-06 11:06:18 浏览: 441
triton-2.1.0-cp310-cp310-win-amd64.whl
5星 · 资源好评率100%
这个错误是由于缺少 Microsoft Visual Studio 所需的文件导致的。在安装 matplotlib 之前,您需要安装一些构建依赖项。请按照以下步骤操作:
1. 在浏览器中打开 https://visualstudio.microsoft.com/zh-hans/vs/ ,然后点击 "免费下载 Visual Studio" 按钮。
2. 下载 Visual Studio Community 版本并按照提示进行安装。
3. 安装完成后,运行 Visual Studio,选择 "工作负载" 标签页,并确保已选择 "C++ 的桌面开发" 选项。
4. 点击 "安装" 按钮,等待安装完成。
5. 安装完成后,重新运行命令 `pip install matplotlib-3.7.2-cp310-cp310-win32.whl`。
这样应该可以解决您遇到的问题。如果仍然有任何疑问,请随时提问。
阅读全文