【问题标题】:How can I install Scipy for pypy from pyenv?如何从 pyenv 为 pypy 安装 Scipy?
【发布时间】:2020-02-16 12:28:07
【问题描述】:

我在 Ubuntu 18.04 上通过 pyenv 使用 pypy。如何为此设置安装 scipy? Installing scipy for pypy is possible,但也许我需要使用 pyenv 做额外的步骤?

错误

$ echo "pypy3.6-7.3.0" > ".python-version"
$ python --version
Python 3.6.9 (1608da62bfc7, Dec 23 2019, 10:50:04)
[PyPy 7.3.0 with GCC 7.3.1 20180303 (Red Hat 7.3.1-5)]

$ python -m pip install scipy
Collecting scipy
  Using cached scipy-1.4.1.tar.gz (24.6 MB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
[...]
      /home/moose/.pyenv/versions/pypy3.6-7.3.0/include/detail/common.h:134:19: fatal error: cstddef: No such file or directory
       #include <cstddef>
[...]
      SystemError: Cannot compile 'Python.h'. Perhaps you need to install pypy-dev|pypy-devel.

full message is on gist.github.com

我的系统

$ apt list --installed | grep python | grep dev
libpython-all-dev/bionic,now 2.7.15~rc1-1 amd64 [installed,automatic]
libpython-dev/bionic,now 2.7.15~rc1-1 amd64 [installed,automatic]
libpython2.7-dev/bionic-updates,now 2.7.17-1~18.04 amd64 [installed,automatic]
libpython3-dev/bionic-updates,now 3.6.7-1~18.04 amd64 [installed,automatic]
libpython3.6-dev/bionic-updates,now 3.6.9-1~18.04 amd64 [installed,automatic]
python-all-dev/bionic,now 2.7.15~rc1-1 amd64 [installed,automatic]
python-dev/bionic,now 2.7.15~rc1-1 amd64 [installed]
python2.7-dev/bionic-updates,now 2.7.17-1~18.04 amd64 [installed,automatic]
python3-dev/bionic-updates,now 3.6.7-1~18.04 amd64 [installed]
python3.6-dev/bionic-updates,now 3.6.9-1~18.04 amd64 [installed]

$ apt list --installed | grep pypy
pypy/bionic,now 5.10.0+dfsg-3build2 amd64 [installed,automatic]
pypy-dev/bionic,bionic,now 5.10.0+dfsg-3build2 all [installed]
pypy-lib/bionic,now 5.10.0+dfsg-3build2 amd64 [installed,automatic]

$ apt list --installed | grep -E "blas|atlas|lapack"
libblas-dev/bionic,now 3.7.1-4ubuntu1 amd64 [installed]
libblas3/bionic,now 3.7.1-4ubuntu1 amd64 [installed,automatic]
libgslcblas0/bionic,now 2.4+dfsg-6 amd64 [installed,automatic]
liblapack-dev/bionic,now 3.7.1-4ubuntu1 amd64 [installed]
liblapack3/bionic,now 3.7.1-4ubuntu1 amd64 [installed,automatic]

【问题讨论】:

  • 这能回答你的问题吗? Cannot install scipy with pypy (g++ build error)
  • 这是从这个问题中删除的答案,我已经评论说它没有帮助。
  • 我也无法在pypy下安装matplotlib(使用pyenv)
  • 您找到解决方案了吗?
  • @aprospero 对不起,我不记得了……但我也不这么认为。当我使用 numpy / scipy 时,我决定不使用 pypy。

标签: ubuntu pypy pyenv


【解决方案1】:

问题是缺少 cstddef,这似乎表明您缺少 g++ 包含库。你是安装 g++ 还是只安装 gcc?

【讨论】:

  • g++ 版本6.5.0 已安装
猜你喜欢
  • 1970-01-01
  • 2016-04-16
  • 1970-01-01
  • 2020-06-01
  • 2014-05-14
  • 1970-01-01
  • 1970-01-01
  • 2015-05-17
  • 2015-08-29
相关资源
最近更新 更多