简体   繁体   English

Pypy3:在 MacOS 上安装 scipy 时出现子进程错误

[英]Pypy3: subprocess error during installation of scipy on MacOS

I'm trying to speed up my python code, to do so I'm trying to use pypy3.我正在尝试加速我的 python 代码,为此我正在尝试使用 pypy3。 Since scipy is required by the code, I'm trying to reinstall it by doing由于代码需要 scipy,我正在尝试重新安装它

pypy3 -mpip install scipy pypy3 -mpip 安装 scipy

But this gives me the following error:但这给了我以下错误:

AssertionError: would build wheel with unsupported tag ('pp37', 'pypy37_pp73', 'macosx_11_3_x86_64')
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for numpy
      Failed to build numpy
      ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip

I've already tried to upgrade pip by doing我已经尝试通过这样做来升级 pip

pip install --upgrade pip pip 安装——升级 pip

and also并且

pypy3 -mpip install --upgrade pip pypy3 -mpip 安装 --upgrade pip

The second actually upgraded it, but didn't fix the issue.第二个实际上升级了它,但没有解决问题。

I'm currently on MacOS 12.6 with an M1 chip.我目前使用的是带有 M1 芯片的 MacOS 12.6。

Thanks谢谢

If your software uses a lot of scipy and numpy, you will not see a speedup with PyPy since in order to support the cython/c code in those libraries PyPy must use an emulation layer, which can be up to 4x slower than CPython.如果您的软件大量使用 scipy 和 numpy,您将看不到 PyPy 的加速,因为为了支持这些库中的 cython/c 代码,PyPy 必须使用仿真层,这可能比 CPython 慢 4 倍 The answer is for those projects to move to HPy , but that will take a while.答案是将这些项目转移到 HPy上,但这需要一段时间。

But back to installing scipy on macos PyPy: I would recommend using conda-forge with PyPy3.8 or PyPy3.9 which would allow you to get all of the scientific python stack pre-compiled.但是回到在 macOS PyPy 上安装 scipy:我建议将 conda- forge 与 PyPy3.8 或 PyPy3.9 一起使用,这将使您能够预编译所有科学 python 堆栈。 They do not yet support the arm64 processor (support for PyPy + arm64 was only released a few weeks ago), but you can run the x86_64 code on your machine.它们尚不支持 arm64 处理器(对 PyPy + arm64 的支持仅在几周前发布),但您可以在您的机器上运行 x86_64 代码。

If you do want to compile from source, PyPy no longer supports python3.7, and the latest release is up to 20% faster, so please try the latest releases .如果你确实想从源代码编译,PyPy 不再支持 python3.7,最新版本最多快 20%,所以请尝试最新版本 If you still encounter problems, please open an issue如果您仍然遇到问题,请打开一个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM