无法在Raspberry Pi 4(Raspbian)上安装scipy

5
我试图使用 python3 -m pip install --user --no-use-pep517 scipy 安装 scipy 库,但是我遇到了以下错误:
ERROR: Failed building wheel for scipy
  Running setup.py clean for scipy
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-spokr6ic/scipy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-spokr6ic/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
       cwd: /tmp/pip-install-spokr6ic/scipy

我使用该代码进行安装,因为pip3 install scipy会出现以下错误:

  ERROR: Failed building wheel for scipy
Failed to build scipy
ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly

我该如何解决这个问题?

Python == 3.7.3

附注:完整的回溯信息有414行,我不知道是否应该在此处包含。


请注意,与树莓派相关的支持可以在我们的姊妹网站[raspberrypi.se]上找到。 - Charles Duffy
顺便提一下,如果在已安装Nix并能够执行aarch64二进制文件的系统上运行nix run --argstr system aarch64-linux '((import <nixpkgs> {}).python3.withPackages (p: [p.scipy]))' -c python3,实际上会启动一个可用scipy的Python repl;如果您有一个标准的32位Raspian,则两个条件都不符合,但在树莓派上达到这一点肯定是可能的 - Charles Duffy
当我试图安装dask-ml时,我也遇到了相同的错误。我能够安装dask,但是dask-ml卡在这里了。正在寻找解决方案。 - MehmedB
1个回答

5

试试这个:

sudo apt update
sudo apt install -y python3-scipy

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接