3

I have been trying to install SciPy through pip with pip install scipy but it gives me the error Failed building wheel for scipy, promptly followed by Failed cleaning build dir for scipy.

I have tried upgrading pip through pip install --upgrade pip as suggested here, installing it through anaconda as suggested here as well as the solutions suggested by pip. Those solutions being:

- `git clean -xdf` (cleans all files)
- `git clean -Xdf` (cleans all versioned files, doesn't touch
                    files that aren't checked into the git repo)

And:

- `pip install .`       (from a git repo or downloaded source
                           release)
- `pip install scipy`   (last SciPy release on PyPI)

When I try to upgrade pip it gives:

Requirement already up-to-date: pip in c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages

When I try to install it through anaconda Windows gives: The program has stopped responding.

All help is appreciated and please feel free to leave a comment telling me is there is more information needed to help solve this issue. I am using Windows 10 as well as Python 3.6.2.

liam
  • 1,918
  • 3
  • 22
  • 28
  • Possible duplicate of [Installing SciPy on windows](https://stackoverflow.com/questions/45485399/installing-scipy-on-windows) – Jonas Adler Aug 09 '17 at 18:51
  • I have tried installing it through anaconda (which I use for spyder) and it still failed – liam Aug 09 '17 at 18:52
  • Try `pip install --upgrade pip` and try again or possibly `python -m pip install --upgrade pip` – Uvar Aug 09 '17 at 18:52
  • 2
    How did it fail with conda? – Jonas Adler Aug 09 '17 at 18:52
  • I get that the program has stopped responding – liam Aug 09 '17 at 18:54
  • 1
    If it's trying to build a wheel, it does sound like it's trying to build native binaries from scratch. It noteably doesn'ts seem to have a Windows build [on PyPI](https://pypi.python.org/pypi/scipy). Have you tried downloading and installing the [unofficial binary](http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy)? (That page is a *godsend* for Windows users. No exaggeration.) – jpmc26 Aug 09 '17 at 21:13
  • I just tried that and got the same issue. I did take longer for me to get the error (as in it was just slower) which got my hopes up but it ended up failing. – liam Aug 09 '17 at 21:19
  • 1
    @LiamHealy I'm suspicious that something might have gotten partially done, effectively corrupting your local install. Try two things: look into site-packages and see if there's garbage there, and see if it will install in a clean virtualenv. – jpmc26 Aug 09 '17 at 21:20
  • 1
    The "failed cleaning build dir" might also indicate some temp files need to be deleted, as well, but I couldn't tell you where they would be. – jpmc26 Aug 09 '17 at 21:22
  • I got a new error when trying the unofficial binaries: `scipy-0.19.1-cp27-cp27m-win32.whl is not a supported wheel on this platform.` – liam Aug 09 '17 at 21:26
  • 1
    `cp27` means it's a CPython 2.7 wheel. You need one of the `cp36` wheels. Make sure you pick the correct one for 64 or 32 bit, too. (`amd64` is the 64 bit one.) – jpmc26 Aug 09 '17 at 21:29

4 Answers4

1

Thanks to jpmc26 in the comments for the solution:

  • You need to install the unofficial binary from: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy

  • To install it, execute: pip install C://Users/YOUR_USERNAME/Downloads/SCIPY_FILE

  • Make sure you use the correct version for your system (32 bit vs 64 bit) and for your Python version

  • You also need to look into site-packages and see if there's garbage there. If there is, delete it.

liam
  • 1,918
  • 3
  • 22
  • 28
0

I've run into that issue before, and my resolution was to install needed dependencies. I seem to recall scipy requires numpy to be installed first. Perhaps try pip install numpy first?

The SciPy install page shows this:

pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
Tim S.
  • 2,187
  • 1
  • 25
  • 40
  • I already have numpy installed: `Requirement already satisfied: numpy in c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages` – liam Aug 09 '17 at 19:53
  • 1
    As for the scipy install page recommendation it installed all the stuff I didn't have before but gave me the same scipy error: `Failed building wheel for scipy` and `Failed cleaning build dir for scipy` – liam Aug 09 '17 at 19:57
0

I struggled as well trying to create a backwards compatible environment for some older tutorial scripts. I needed Scipy==0.18.2. So I searched on Anaconda and found:
conda install -c esri scipy
This worked without a hitch.

Alex G
  • 807
  • 6
  • 13
0

the best way to download the package via the following link: https://pypi.org/project/scipy/#files

install this file through pip install: you can see install downloaded package