0

So I just attempted to install scipy and it massively fails on me. After days of playing and learning, I have slowly got the hang of install packages and modules, but on this one, I have been stuck for a while now. Prior to this, I did also install Numpy via the command prompt (navigating to the scripts directory and then pip installing).

My installation code:

C:\WINDOWS\system32>pip install scipy

And my error (brace yourselves)

Collecting scipy
  Using cached scipy-0.19.1.tar.gz
Building wheels for collected packages: scipy
  Running setup.py bdist_wheel for scipy ... error
  Complete output from command c:\users\mehdi\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Mehdi\\AppData\\Local\\Temp\\pip-build-xb5j6dtf\\scipy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\Mehdi\AppData\Local\Temp\tmpfpk_rpetpip-wheel- --python-tag cp36:
  lapack_opt_info:
  lapack_mkl_info:
    libraries mkl_rt not found in ['c:\\users\\mehdi\\appdata\\local\\programs\\python\\python36-32\\lib', 'C:\\', 'c:\\users\\mehdi\\appdata\\local\\programs\\python\\python36-32\\libs']
    NOT AVAILABLE

  openblas_lapack_info:
    libraries openblas not found in ['c:\\users\\mehdi\\appdata\\local\\programs\\python\\python36-32\\lib', 'C:\\', 'c:\\users\\mehdi\\appdata\\local\\programs\\python\\python36-32\\libs']
    NOT AVAILABLE

  atlas_3_10_threads_info:
  Setting PTATLAS=ATLAS
  c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\system_info.py:1051: UserWarning: Specified path C:\projects\numpy-wheels\windows-wheel-builder\atlas-builds\atlas-3.10.1-sse2-32\lib is invalid.
    pre_dirs = system_info.get_paths(self, section, key)
  <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
    NOT AVAILABLE

  atlas_3_10_info:
  <class 'numpy.distutils.system_info.atlas_3_10_info'>
    NOT AVAILABLE

  atlas_threads_info:
  Setting PTATLAS=ATLAS
  <class 'numpy.distutils.system_info.atlas_threads_info'>
    NOT AVAILABLE

  atlas_info:
  <class 'numpy.distutils.system_info.atlas_info'>
    NOT AVAILABLE

  c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\system_info.py:572: UserWarning:
      Atlas (http://math-atlas.sourceforge.net/) libraries not found.
      Directories to search for the libraries can be specified in the
      numpy/distutils/site.cfg file (section [atlas]) or by setting
      the ATLAS environment variable.
    self.calc_info()
  lapack_info:
    libraries lapack not found in ['c:\\users\\mehdi\\appdata\\local\\programs\\python\\python36-32\\lib', 'C:\\', 'c:\\users\\mehdi\\appdata\\local\\programs\\python\\python36-32\\libs']
    NOT AVAILABLE

  c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\system_info.py:572: UserWarning:
      Lapack (http://www.netlib.org/lapack/) libraries not found.
      Directories to search for the libraries can be specified in the
      numpy/distutils/site.cfg file (section [lapack]) or by setting
      the LAPACK environment variable.
    self.calc_info()
  lapack_src_info:
    NOT AVAILABLE

  c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\system_info.py:572: UserWarning:
      Lapack (http://www.netlib.org/lapack/) sources not found.
      Directories to search for the sources can be specified in the
      numpy/distutils/site.cfg file (section [lapack_src]) or by setting
      the LAPACK_SRC environment variable.
    self.calc_info()
    NOT AVAILABLE

  Running from scipy source directory.
  non-existing path in 'scipy\\integrate': 'quadpack.h'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\Mehdi\AppData\Local\Temp\pip-build-xb5j6dtf\scipy\setup.py", line 416, in <module>
      setup_package()
    File "C:\Users\Mehdi\AppData\Local\Temp\pip-build-xb5j6dtf\scipy\setup.py", line 412, in setup_package
      setup(**metadata)
    File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\core.py", line 135, in setup
      config = configuration()
    File "C:\Users\Mehdi\AppData\Local\Temp\pip-build-xb5j6dtf\scipy\setup.py", line 336, in configuration
      config.add_subpackage('scipy')
    File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 1029, in add_subpackage
      caller_level = 2)
    File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 998, in get_subpackage
      caller_level = caller_level + 1)
    File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 935, in _get_configuration_from_setup_py
      config = setup_module.configuration(*args)
    File "scipy\setup.py", line 15, in configuration
      config.add_subpackage('linalg')
    File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 1029, in add_subpackage
      caller_level = 2)
    File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 998, in get_subpackage
      caller_level = caller_level + 1)
    File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 935, in _get_configuration_from_setup_py
      config = setup_module.configuration(*args)
    File "scipy\linalg\setup.py", line 20, in configuration
      raise NotFoundError('no lapack/blas resources found')
  numpy.distutils.system_info.NotFoundError: no lapack/blas resources found

  ----------------------------------------
  Failed building wheel for scipy
  Running setup.py clean for scipy
  Complete output from command c:\users\mehdi\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Mehdi\\AppData\\Local\\Temp\\pip-build-xb5j6dtf\\scipy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:

  `setup.py clean` is not supported, use one of the following instead:

    - `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)

  Add `--force` to your command to use it anyway if you must (unsupported).


  ----------------------------------------
  Failed cleaning build dir for scipy
Failed to build scipy
Installing collected packages: scipy
  Running setup.py install for scipy ... error
    Complete output from command c:\users\mehdi\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Mehdi\\AppData\\Local\\Temp\\pip-build-xb5j6dtf\\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 C:\Users\Mehdi\AppData\Local\Temp\pip-ok4b66qg-record\install-record.txt --single-version-externally-managed --compile:

    Note: if you need reliable uninstall behavior, then install
    with pip instead of using `setup.py install`:

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


    lapack_opt_info:
    lapack_mkl_info:
      libraries mkl_rt not found in ['c:\\users\\mehdi\\appdata\\local\\programs\\python\\python36-32\\lib', 'C:\\', 'c:\\users\\mehdi\\appdata\\local\\programs\\python\\python36-32\\libs']
      NOT AVAILABLE

    openblas_lapack_info:
      libraries openblas not found in ['c:\\users\\mehdi\\appdata\\local\\programs\\python\\python36-32\\lib', 'C:\\', 'c:\\users\\mehdi\\appdata\\local\\programs\\python\\python36-32\\libs']
      NOT AVAILABLE

    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
    c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\system_info.py:1051: UserWarning: Specified path C:\projects\numpy-wheels\windows-wheel-builder\atlas-builds\atlas-3.10.1-sse2-32\lib is invalid.
      pre_dirs = system_info.get_paths(self, section, key)
    <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
      NOT AVAILABLE

    atlas_3_10_info:
    <class 'numpy.distutils.system_info.atlas_3_10_info'>
      NOT AVAILABLE

    atlas_threads_info:
    Setting PTATLAS=ATLAS
    <class 'numpy.distutils.system_info.atlas_threads_info'>
      NOT AVAILABLE

    atlas_info:
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE

    c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\system_info.py:572: UserWarning:
        Atlas (http://math-atlas.sourceforge.net/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [atlas]) or by setting
        the ATLAS environment variable.
      self.calc_info()
    lapack_info:
      libraries lapack not found in ['c:\\users\\mehdi\\appdata\\local\\programs\\python\\python36-32\\lib', 'C:\\', 'c:\\users\\mehdi\\appdata\\local\\programs\\python\\python36-32\\libs']
      NOT AVAILABLE

    c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\system_info.py:572: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      self.calc_info()
    lapack_src_info:
      NOT AVAILABLE

    c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\system_info.py:572: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      self.calc_info()
      NOT AVAILABLE

    Running from scipy source directory.
    non-existing path in 'scipy\\integrate': 'quadpack.h'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Mehdi\AppData\Local\Temp\pip-build-xb5j6dtf\scipy\setup.py", line 416, in <module>
        setup_package()
      File "C:\Users\Mehdi\AppData\Local\Temp\pip-build-xb5j6dtf\scipy\setup.py", line 412, in setup_package
        setup(**metadata)
      File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\core.py", line 135, in setup
        config = configuration()
      File "C:\Users\Mehdi\AppData\Local\Temp\pip-build-xb5j6dtf\scipy\setup.py", line 336, in configuration
        config.add_subpackage('scipy')
      File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 1029, in add_subpackage
        caller_level = 2)
      File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 998, in get_subpackage
        caller_level = caller_level + 1)
      File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 935, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "scipy\setup.py", line 15, in configuration
        config.add_subpackage('linalg')
      File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 1029, in add_subpackage
        caller_level = 2)
      File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 998, in get_subpackage
        caller_level = caller_level + 1)
      File "c:\users\mehdi\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 935, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "scipy\linalg\setup.py", line 20, in configuration
        raise NotFoundError('no lapack/blas resources found')
    numpy.distutils.system_info.NotFoundError: no lapack/blas resources found

    ----------------------------------------
Command "c:\users\mehdi\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Mehdi\\AppData\\Local\\Temp\\pip-build-xb5j6dtf\\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 C:\Users\Mehdi\AppData\Local\Temp\pip-ok4b66qg-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Mehdi\AppData\Local\Temp\pip-build-xb5j6dtf\scipy\

As a beginner, I really don't underdstand any of this.

Any help is appriciated, Thanks

  • 1
    Why does nobody read the [docs](https://www.scipy.org/install.html)? Windows and pip install scipy is a no-go (for 99% of all users; probably until scipy 1.0) – sascha Sep 03 '17 at 20:46
  • 3
    Possible duplicate of [Installing NumPy and SciPy on 64-bit Windows (with Pip)](https://stackoverflow.com/questions/26657334/installing-numpy-and-scipy-on-64-bit-windows-with-pip) – ev-br Sep 03 '17 at 22:42

3 Answers3

0

So, now you have basic understanding of library stuff my next step advice is: never start any python project without a virtual enviroment. Python has a library called virtualenv that shields your project from permissions, previously stuff installed, etc,etc. You will probably get rid of this problem and many others you would come up if you don't use virtualenv.

Check official here virtualenv. Installation for windows you can find here. After you install and activate your virtualenv, try to install scipy again.

Alex
  • 1,252
  • 7
  • 21
  • hey thanks for the reply. I tried what you said but it still gives the same problem. When I try to run the scipy script, it says that it has already met the requirements. But when I do 'import scipy' it says that there is an error. It's funny because all of this started with a 'ModuleNotFoundError: No module named 'scipy'' and it has led to all of this! –  Sep 03 '17 at 20:42
  • 1
    Ah windows! It dominates you! :P Definitely windows is looking at stuff at the wrong place and it's hard to configure that. When I started python, I went to linux because python is native there. Install ubuntu from scratch and type python on terminal and bang... In Linux I can guide you until you get a clean install and scipy running really quickly. Windows I can't. Check free online resources for a linux instance like c9.io (I'm a happy user) if you want to go this way. Or install ubuntu 16 with GUI in your machine. Its a rewarding adventure! ;) – Alex Sep 03 '17 at 20:59
  • what do I need to get started? Like a USB stick or something? I can either wait until my friend helps me install it on Tuesday or do it myself and pray that it is easy. –  Sep 03 '17 at 21:14
  • 1
    Just follow the docs. They tell you to use one of the pre-configured packages (available in some python-distributions, not the official one; if you are on windows), so why not do it? Yes, Anaconda for example just works! – sascha Sep 03 '17 at 21:23
  • I upvoted last comment because that's the other way to go. Maybe is a matter of taste, but I feel like understanding more when doing stuff in Linux. No USB stick if you dont want. Just go to c9.io and make a free account to have a linux virtual machine for you to get started – Alex Sep 03 '17 at 21:33
  • @sascha and Tico I have seen how using a Linux machine can be beneficial and I was thinking about having installed on the side but I never really had a reason why, until I came across Python. On my previous machine which was a Mac (lol I know) I actually saw how easy it was to use with python. Since it comes with Python 2.7 installed as default as well. So I think it is the better way overall. I will look at a few tuts and see what I can do. –  Sep 03 '17 at 21:43
0

I suspect (because I encountered a very similar set of error messages) that scipy failed because a prereq for that is numpy+mkl. So you need to uninstall numpy and replace it with numpy+mkl - that has the distutils code that the error messages are referring to. See more on that at https://github.com/scipy/scipy/issues/7221

I also suspect that some of the package imports were failing, due to the installs not being correctly optimized for W10. An invaluable resource to resolve this is a set of Windows optimized .whl (wheel) files that can be found at http://www.lfd.uci.edu/~gohlke/pythonlibs/

RustyB
  • 147
  • 1
  • 11
  • I have installed numpy+mkl but I have numpy installed as well. So I will try and uninstall the numpy on its own that to see what happens. –  Sep 04 '17 at 10:16
  • Actually, now that I think back, I also separately installed Atlas. I don't know if that has any bearing on the issue you encountered. And, once again, I installed most of those pre-reqs from the Christoph Gohlke .whl files linked above. – RustyB Sep 04 '17 at 15:41
-2

Hello you can download library in https://sourceforge.net/projects/scipy/. Then you can use it to compile using nmake or cmake. If you have installed Visual Studio Please go to c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC. On command prompt Please run vcvarsall.bat.

Now you can use nmake. Then please move directory into source code directory using cd command. then

nmake 
nmake install

all done. I hope you solve issues by my suggestion

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Mike Will
  • 43
  • 1
  • 5
  • Hey I am slightly confused, I tried a few things that are similar to what you suggested but either I don't understand it or I am doing it wrong. –  Sep 03 '17 at 20:33
  • Hey Download source code so you can see Makefile and configure. you can compile it using cmake or nmake. – Mike Will Sep 03 '17 at 20:44
  • No. Don't use sourceforge for this. – ev-br Sep 03 '17 at 22:41