pip无法为scipy建立轮子 [英] pip failing to build wheels for scipy

查看:209
本文介绍了pip无法为scipy建立轮子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚下载了新的python 3.8,并且尝试使用以下命令安装scipy软件包:

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

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

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

推荐答案

我认为我遇到了与您相同的问题.错误代码是否显示此消息

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?

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

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

从此处下载: https://gcc.gnu.org/wiki/GFortran#download

此解决方案为我解决了该问题.检出:还是可以吗?在Mac OS X上brew安装gcc后,由于缺少fortran编译器而无法安装scipy.

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.

这篇关于pip无法为scipy建立轮子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆