You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

pip安装pandas --pre失败,找不到vswhere.exe的解决求助

问题:安装预发布版Pandas时因找不到vswhere.exe失败

执行pip install pandas --pre时出现如下错误:

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升级工具
  • 添加--pre参数
  • 重新下载安装包

解决方法

方法1:安装/修复Visual Studio构建工具

vswhere.exe是Visual Studio Installer的核心组件,需确保安装了Visual Studio或Visual Studio Build Tools,且勾选**Desktop development with C++**工作负载:

  1. 打开Visual Studio Installer(未安装可直接下载安装)
  2. 选中已安装的Visual Studio实例,点击"修改"
  3. 在工作负载列表中勾选"Desktop development with C++",完成安装后重试

方法2:手动添加vswhere.exe路径到环境变量

若已安装Visual Studio但路径未被系统识别:

  1. 打开系统属性 → 高级 → 环境变量
  2. 在系统变量的PATH中添加路径:C:\Program Files (x86)\Microsoft Visual Studio\Installer\
  3. 重启命令提示符/终端,重新执行pip install pandas --pre

方法3:安装预编译wheel包(跳过源码编译)

直接安装预编译的二进制包,避免触发源码编译流程,执行命令:

pip install pandas --pre --only-binary :all:

方法4:修复Visual Studio Installer

如果vswhere.exe确实缺失,可修复Visual Studio Installer:

  1. 打开控制面板 → 程序和功能
  2. 找到"Microsoft Visual Studio Installer",右键选择"更改"
  3. 点击"修复"完成流程后重试

内容的提问来源于stack exchange,提问作者jieije0330

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.10 14:00:51