0

How can I install scipy package for Python2.7 in Windows 10? I get this error:

PS D:\simcut> C:\Python27\Scripts\pip.exe install scipy
Collecting scipy
  Using cached scipy-0.18.1.tar.gz
Installing collected packages: scipy
  Running setup.py install for scipy ... error
    Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\mona\\appdata\\local\\tem
p\\pip-build-6oexav\\scipy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(comp
ile(code, __file__, 'exec'))" install --record c:\users\mona\appdata\local\temp\pip-vtfkqm-record\install-record.txt --single-version-ext
ernally-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:
    mkl_info:
      libraries mkl,vml,guide not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
      NOT AVAILABLE

      NOT AVAILABLE

    atlas_threads_info:
    Setting PTATLAS=ATLAS
      libraries ptf77blas,ptcblas,atlas not found in c:\python27\lib
      libraries lapack_atlas not found in c:\python27\lib
      libraries ptf77blas,ptcblas,atlas not found in C:\
      libraries lapack_atlas not found in C:\
      libraries ptf77blas,ptcblas,atlas not found in c:\python27\libs
      libraries lapack_atlas not found in c:\python27\libs
    numpy.distutils.system_info.atlas_threads_info
      NOT AVAILABLE

    atlas_info:
      libraries f77blas,cblas,atlas not found in c:\python27\lib
      libraries lapack_atlas not found in c:\python27\lib
      libraries f77blas,cblas,atlas not found in C:\
      libraries lapack_atlas not found in C:\
      libraries f77blas,cblas,atlas not found in c:\python27\libs
      libraries lapack_atlas not found in c:\python27\libs
    numpy.distutils.system_info.atlas_info
      NOT AVAILABLE

    c:\python27\lib\site-packages\numpy\distutils\system_info.py:1408: 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.
      warnings.warn(AtlasNotFoundError.__doc__)
    lapack_info:
      libraries lapack not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
      NOT AVAILABLE

    c:\python27\lib\site-packages\numpy\distutils\system_info.py:1419: 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.
      warnings.warn(LapackNotFoundError.__doc__)
    lapack_src_info:
      NOT AVAILABLE

    c:\python27\lib\site-packages\numpy\distutils\system_info.py:1422: 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.
      warnings.warn(LapackSrcNotFoundError.__doc__)
      NOT AVAILABLE

    Running from scipy source directory.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\mona\appdata\local\temp\pip-build-6oexav\scipy\setup.py", line 415, in <module>
        setup_package()
      File "c:\users\mona\appdata\local\temp\pip-build-6oexav\scipy\setup.py", line 411, in setup_package
        setup(**metadata)
      File "c:\python27\lib\site-packages\numpy\distutils\core.py", line 152, in setup
        config = configuration()
      File "c:\users\mona\appdata\local\temp\pip-build-6oexav\scipy\setup.py", line 335, in configuration
        config.add_subpackage('scipy')
      File "c:\python27\lib\site-packages\numpy\distutils\misc_util.py", line 1003, in add_subpackage
        caller_level = 2)
      File "c:\python27\lib\site-packages\numpy\distutils\misc_util.py", line 972, in get_subpackage
        caller_level = caller_level + 1)
      File "c:\python27\lib\site-packages\numpy\distutils\misc_util.py", line 909, 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:\python27\lib\site-packages\numpy\distutils\misc_util.py", line 1003, in add_subpackage
        caller_level = 2)
      File "c:\python27\lib\site-packages\numpy\distutils\misc_util.py", line 972, in get_subpackage
        caller_level = caller_level + 1)
      File "c:\python27\lib\site-packages\numpy\distutils\misc_util.py", line 909, 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:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\mona\\appdata\\local\\temp\\pip-build-6oexav\\sci
py\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exe
c'))" install --record c:\users\mona\appdata\local\temp\pip-vtfkqm-record\install-record.txt --single-version-externally-managed --compil
e" failed with error code 1 in c:\users\mona\appdata\local\temp\pip-build-6oexav\scipy\

I can install other packages like networkx using pip install networkx though.

Mona Jalal
  • 34,860
  • 64
  • 239
  • 408

2 Answers2

3

There are two ways:

Scipy website states:

Windows does not have any package manager analogous to that in Linux, so installing one of the scientific Python distributions mentioned above is preferred. However, if that is not an option, Christoph Gohlke provides pre-built Windows installers for many Python packages, including all of the core SciPy stack, which work extremely well.

  1. Hence You can download the .whl from here and do C:\Python27\Scripts\pip.exe install <wheel name>. Note: make sure the .whl is in the same directory as pip.
  2. If that does not work:

See the easiest solution is to unzip the .whl file using 7-zip. Then in the unzipped directory you will find the module which you can copy and paste in the directory C:/Python34/Lib/site-packages/ (or wherever else you have installed Python).

The second point is from this SO answer

[EDIT]

Friendly note: use win-bash(from the anniversary update), it's really good.

Community
  • 1
  • 1
Ganesh Kathiresan
  • 2,068
  • 2
  • 22
  • 33
  • `PS D:\simcut> C:\Python27\Scripts\pip.exe install .\scipy-0.18.1-cp27-cp27m-win32.whl Processing d:\simcut\scipy-0.18.1-cp27-cp27m-win32.whl Installing collected packages: scipy Successfully installed scipy-0.18.1 PS D:\simcut> python Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.` – Mona Jalal Feb 09 '17 at 01:52
  • `>>> import scipy Traceback (most recent call last): File "", line 1, in File "C:\Python27\lib\site-packages\scipy\__init__.py", line 61, in from numpy._distributor_init import NUMPY_MKL # requires numpy+mkl ImportError: No module named _distributor_init` – Mona Jalal Feb 09 '17 at 01:52
  • Do you have `numpy`? Else install the same. – Ganesh Kathiresan Feb 09 '17 at 01:59
  • I do have numpy – Mona Jalal Feb 09 '17 at 02:12
  • http://stackoverflow.com/a/37281256 I think this should solve your problem – Ganesh Kathiresan Feb 09 '17 at 03:25
0

I believe that the simplest way of getting Scipy to work on Windows is getting WinPython.

synweap15
  • 454
  • 5
  • 9