pip failing to build wheels for scipy

≡放荡痞女 提交于 2020-08-07 07:45:50

问题


I've just downloaded the new python 3.8 and I'm trying to install the scipy package using the following:

pip3.8 install scipy

However the build fails with the following error:

**Failed to build scipy**

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

How can I install this using pip? I tried using the --no-binary version:

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

but ended up with an even scarier error:

**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.**

回答1:


I think I got the same issue as you did. Did the error code have this message

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

Because to me, it sounds like a Fortran compiler error, and not a mistake of python per se. I think what happens is that the wheel requires some sort of Fortran compiler and when the installation doesn't find one it simply terminates the build. Here is the solution that I found:

Linux

sudo apt install gfortran

Windows / Mac

Download it from here: https://gcc.gnu.org/wiki/GFortran#download

This solution fixed it for me. Check out: Still can't install scipy due to missing fortran compiler after brew install gcc on Mac OS X for more details.



来源:https://stackoverflow.com/questions/58441549/pip-failing-to-build-wheels-for-scipy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!