Search code examples
pythonvisual-studio-codepypyipynb

Cannot run a notebook using pypy with vscode because "could not build wheels for psutil, which is required to install pyproject.toml-based projects"


I am trying to run a .ipynb file using pypy with vscode however when I try to run one of the cell, I have an error saying I need to install the ipykernel package but when I do install the package, I have the following error:

 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

Does someone have an idea on what is the issue there, it will greatly help me.

I've tried using older versions of pip like in this topic but as said in the error message it is not a problem with pip so it didn't work.


Solution

  • In the complete error message, you should remind you to install Microsoft Visual C++ Build Tools. Then try the following steps:

    1. Upgrade pip and setuptools
      pip install --upgrade pip
      pip install --upgrade setuptools
      
    2. Install psutil alone
    3. Or download psutil to local installation
      pip install path/to/downloaded_wheel.whl