pip install pandas --pre
Using cached pandas-2.1.0.tar.gz (4.3 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... 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:\TEMP\pip-install-z0_0skv2\pandas_0e513c02a1e4406d845be40ba34f7a2d C:\TEMP\pip-install-z0_0skv2\pandas_0e513c02a1e4406d845be40ba34f7a2d\.mesonpy-t_en0olc\build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --vsenv --native-file=C:\TEMP\pip-install-z0_0skv2\pandas_0e513c02a1e4406d845be40ba34f7a2d\.mesonpy-t_en0olc\build\meson-python-native-file.ini
The Meson build system
Version: 1.0.1
Source dir: C:\TEMP\pip-install-z0_0skv2\pandas_0e513c02a1e4406d845be40ba34f7a2d
Build dir: C:\TEMP\pip-install-z0_0skv2\pandas_0e513c02a1e4406d845be40ba34f7a2d\.mesonpy-t_en0olc\build
Build type: native build
Project name: pandas
Project version: 2.1.0
..\..\meson.build:2:0: ERROR: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
A full log can be found at C:\TEMP\pip-install-z0_0skv2\pandas_0e513c02a1e4406d845be40ba34f7a2d\.mesonpy-t_en0olc\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.
以上是我的错误消息。
我已经尝试过:
py -m pip install --upgrade pip setuptools wheel
。
2.添加--pre
。
3.重新下载但这不是成功的方法。
我也有同样的问题。 Pandas 2.1.3 需要的 Python 版本至少为 3.9。请检查您的Python版本是否不低于该版本。我通过安装最新的Python版本解决了这个问题。
顺便说一句,您还需要安装新的Python版本并更新Python环境变量。例如,在环境变量中指定新Python版本的路径,例如C:\Python\Python312\和C:\Python\Python312\Scripts。之后,使用 python -V 检查设置是否正确。完成此操作后,pip install pandas 命令应该可以正常工作。