问题描述
我用pypy创建了一个virtualenv并尝试安装scipy,但安装以以下错误结束:
I created a virtualenv with pypy and tried to install scipy, but installation ended with the following error:
distutils.errors.DistutilsError: 安装脚本退出时出现错误:命令cc -O2 -fPIC -Wimplicit -O2 -fPIC -Wimplicit -O2 -fPIC -Wimplicit -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE1GE_S4RCE_=1 -DNO_ATLAS_INFO=1 -DHAVE_CBLAS -Ibuild/src.linux-x86_64-3.2/numpy/core/src/private -Inumpy/core/include -Ibuild/src.linux-x86_64-3.2/numpy/core/include/numpy-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort-I/home/luke/Programowanie/Python/connect4/venv-pypy/include -Ibuild/src.linux-x86_64-3.2/numpy/core/src/private -Ibuild/src.linux-x86_64-3.2/numpy/core/src/private -Ibuild/src.linux-x86_64-3.2/numpy/core/src/private -c numpy/core/src/multiarray/scalarapi.c -o build/temp.linux-x86_64-3.2/numpy/core/src/multiarray/scalarapi.o" 失败,退出状态为 1
有一个特定的 numpy 版本适合 pypy,但我发现的关于 scipy 的唯一东西是旧的呼吁捐款.从那以后有什么变化吗?
There is a specific numpy version suited for pypy, but the only thing I found about scipy is an old call for donations. Has anything changed since then?
推荐答案
是的,有可能,从 Scipy 1.1.0.然而,需要足够新的 PyPy (>= 6.0.0) 和 Numpy,numpy>= 1.14.3,最好在发布时 numpy>=1.15.0.安装可以通过通常的方式完成
Yes, it is possible, starting from Scipy 1.1.0. New enough PyPy (>= 6.0.0) and Numpy are however required, numpy>= 1.14.3, and preferably numpy>=1.15.0 when it's released. Installation can be done via the usual
pypy3 -mpip install numpy
pypy3 -mpip install scipy
假设你已经安装了 BLAS/LAPACK,那么首先你应该确保你能够从源代码在普通 Python 上安装 numpy/scipy.
assuming you have BLAS/LAPACK installed, so first you should make sure you are able to install numpy/scipy on normal Python from sources.
可能没有人尝试过这是否适用于 Windows 上的 Pypy,所以您只能靠自己.它也可能不适用于 NumPyPy ---您需要香草 Numpy.
Nobody probably has tried whether this works with Pypy on Windows, so you are on your own there. It also probably won't work with NumPyPy --- you need the vanilla Numpy.
其他答案说不",因为那是 2018 年 5 月之前的情况.
The other answers say "No" since that was the situation before May 2018.
这篇关于pypy下可以安装scipy吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!