无法使用 pypy 和 vscode 运行笔记本,因为“无法为 psutil 构建轮子,这是安装基于 pyproject.toml 的项目所必需的”

问题描述 投票:0回答:1

我正在尝试使用 pypy 和 vscode 来运行 .ipynb 文件,但是当我尝试运行其中一个单元时,出现错误,提示我需要安装 ipykernel 软件包,但是当我安装该软件包时,出现以下错误:

 error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for psutil
Failed to build psutil
ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects

有人知道那里的问题是什么,这对我有很大帮助。

我已经尝试使用旧版本的 pip,如 this topic 中所示,但正如错误消息中所述,这不是 pip 的问题,因此它不起作用。

python visual-studio-code pypy ipynb
1个回答
0
投票

在完整的错误消息中,应该提醒您安装Microsoft Visual C++ Build Tools。然后尝试以下步骤:

  1. 升级
    pip
    setuptools
    pip install --upgrade pip
    pip install --upgrade setuptools
    
  2. 单独安装
    psutil
  3. 下载
    psutil
    到本地安装
    pip install path/to/downloaded_wheel.whl
    
© www.soinside.com 2019 - 2024. All rights reserved.