【问题标题】:pip failing to build wheels for scipypip 未能为 scipy 制造轮子
【发布时间】:2019-10-17 22:33:12
【问题描述】:

我刚刚下载了新的python 3.8,我正在尝试使用以下方法安装scipy 包:

pip3.8 install scipy

但是构建失败并出现以下错误:

**Failed to build scipy**

**ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly**

如何使用pip 安装它?我尝试使用--no-binary 版本:

pip3.8 install --no-binary :all: scipy

但最终出现了一个更可怕的错误:

**ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8p/01_5ykld02v61rtjl8k_8j200000gp/T/pip-install-wlnk_0jg/scipy/setup.py'"'"'; __file__='"'"'/private/var/folders/8p/01_5ykld02v61rtjl8k_8j200000gp/T/pip-install-wlnk_0jg/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 /private/var/folders/8p/01_5ykld02v61rtjl8k_8j200000gp/T/pip-record-01j_ddt8/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.**

【问题讨论】:

  • Python 3.8 太年轻了,你现在真的需要吗?
  • @phd 谢谢......所以我想这就是它不断失败的原因? numpy 等似乎工作正常。您是否建议等待几个月再将版本更改为 Python 3.8
  • 我的规则是“避免 .0,至少等待 .1” :-) 那时 3rd-party 包也是固定的。
  • 我建议等待 anaconda 并使用它。我们已经为 Python 3.8 等待了将近 30 年(自 Python 首次出现以来),我们可以再等几周才能开始使用它。
  • 这是下面提到的fortran问题。关于 3.8 成熟度的评论是固执己见的。

标签: scipy pip pep python-3.8


【解决方案1】:

我想我遇到了和你一样的问题。错误码有没有这个信息

error: library dfftpack has Fortran sources but no Fortran compiler found?

因为对我来说,这听起来像是 Fortran 编译器错误,而不是 python 本身的错误。我认为发生的情况是轮子需要某种 Fortran 编译器,当安装找不到时,它只会终止构建。这是我找到的解决方案:

Linux

sudo apt install gfortran

Windows / Mac

从这里下载:https://gcc.gnu.org/wiki/GFortran#download

这个解决方案为我解决了这个问题。查看:Still can't install scipy due to missing fortran compiler after brew install gcc on Mac OS X 了解更多详情。

【讨论】:

  • 我在运行 Buster Desktop python 3.7.3 的 Raspberry Pi 4(带 4GB RAM)上尝试了这个,它似乎挂断了构建轮子,但它最终在至少半小时后工作.太慢了,状态轮经常几分钟不动
猜你喜欢
  • 2021-11-17
  • 2021-01-19
  • 2016-05-12
  • 2021-06-20
  • 2022-07-21
  • 2020-12-06
  • 2019-11-05
  • 2017-02-28
  • 1970-01-01
相关资源
最近更新 更多