【发布时间】:2020-06-01 14:42:59
【问题描述】:
从 2020 年开始,可以使用 pypy 安装 scipy。 (Is it possible to install scipy under pypy?)
pypy3 -mpip install scipy
但是,车轮因此类错误而失败:
error: Command "g++ -pthread -DNDEBUG -O2 -fPIC -I/tmp/pip-build-env-lfdsn__t/overlay/site-packages/numpy/core/include -I/usr/lib/pypy3/include -c scipy/_lib/_uarray/_uarray_dispatch.cxx -o build/temp.linux-x86_64-3.6/scipy/_lib/_uarray/_uarray_dispatch.o -MMD -MF build/temp.linux-x86_64-3.6/scipy/_lib/_uarray/_uarray_dispatch.o.d -std=c++14 -fvisibility=hidden" failed with exit status 1
ERROR: Failed building wheel for scipy
scipy 构建失败 错误:无法为使用 PEP 517 且无法直接安装的 scipy 构建轮子
使用 --no-use-pep517 选项给出类似的结果:
error: Command "g++ -pthread -DNDEBUG -O2 -fPIC -I/home/ezako/.local/lib/pypy3.6/site-packages/numpy/core/include -I/usr/lib/pypy3/include -c scipy/_lib/_uarray/_uarray_dispatch.cxx -o build/temp.linux-x86_64-3.6/scipy/_lib/_uarray/_uarray_dispatch.o -MMD -MF build/temp.linux-x86_64-3.6/scipy/_lib/_uarray/_uarray_dispatch.o.d -std=c++14 -fvisibility=hidden" failed with exit status 1
ERROR: Command errored out with exit status 1: /usr/bin/pypy3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2ffzze2v/scipy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2ffzze2v/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-8avik0f1/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/ezako/.local/include/python3.6/scipy Check the logs for full command output.
Numpy 已成功安装 pypy3。
➜ pypy3 -V
Python 3.6.9 (7.3.0+dfsg-1~ppa1~ubuntu19.04, Dec 26 2019, 11:14:16)
[PyPy 7.3.0 with GCC 8.3.0]
【问题讨论】:
-
pypy -V显示什么?您应该至少使用 PyPy 7.3.0 -
... 为什么是
g++而不是gcc? -
已使用此信息编辑答案。
-
您可以尝试使用
pypy3 -mpip install -v scipy并报告实际失败的原因吗?这似乎是一些汇编,但究竟是什么?
标签: python-3.x scipy pypy