3

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.**
Nico Schlömer
  • 53,797
  • 27
  • 201
  • 249
ajrlewis
  • 2,968
  • 3
  • 33
  • 67
  • Python 3.8 is too young, do you really need it right now? – phd Oct 18 '19 at 08:40
  • @phd Thanks .... So I guess that's the reason it keeps failing? `numpy` etc. seem to work okay. Do you suggest waiting some months before changing versions to **Python 3.8**? – ajrlewis Oct 18 '19 at 09:31
  • 2
    My rule is "avoid .0, wait at least for .1" :-) At that time 3rd-party packages are also fixed. – phd Oct 18 '19 at 10:22
  • 1
    I would recommend to wait for anaconda and use that. We've waited nearly 30 years for Python 3.8 (since Python first appeared), we can wait a few weeks more to start using it. – gerrit Oct 18 '19 at 14:01
  • This is the fortran issue mentioned below. Comments re 3.8 maturity are opinionated. – Marcin Oct 30 '19 at 22:54
  • I had the same issue with 3.7 – bli Dec 17 '19 at 19:53

1 Answers1

6

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.

  • 1
    I tried this on a Raspberry Pi 4 (w/ 4GB RAM) running Buster Desktop python 3.7.3 and it seemed to hang up on building the wheel, but it eventually worked after at least half an hour. It was so slow that the status wheel often did not move for minutes – rfii Jul 30 '20 at 00:31