pip在为Scipy构建wheel时失败

3

我刚刚下载了新的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
@phd 谢谢...所以我猜这就是它一直失败的原因?numpy等似乎工作正常。您建议在更改版本到Python 3.8之前等待几个月吗? - ajrlewis
2
我的规则是“避免使用.0版本,至少等待.1版本” :-) 这时第三方包也会被修复。 - phd
1
我建议等待Anaconda并使用它。我们已经等了将近30年才迎来Python 3.8(自从Python首次出现以来),再多等几周来开始使用它也无妨。 - gerrit
这是下面提到的Fortran问题。关于3.8成熟度的评论是主观看法。 - Marcin
我也遇到了3.7的同样问题。 - bli
1个回答

6
我认为我和你遇到了相同的问题。错误代码是否有这个信息: 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 以获取更多详细信息。

1
我在运行Buster桌面Python 3.7.3的Raspberry Pi 4(带有4GB RAM)上尝试了这个,似乎卡在构建轮子上,但至少半个小时后它最终成功了。速度非常慢,状态轮经常几分钟不动。 - rfii

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