【问题标题】:Problems install SciPy安装 SciPy 的问题
【发布时间】:2018-09-12 04:15:04
【问题描述】:

我在安装 SciPy 时简直是噩梦。我让它在 anaconda 上工作,但那个解释器没有我的其他库。

使用这个命令python -m pip install scipy 产生错误:

Collecting scipy
  Using cached scipy-0.19.0.zip
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\\loba3\\appdata\\local\\temp\\pip-build-9_n1ir\\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\loba3\appdata\local\temp\pip-vxgx6l-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:
    openblas_lapack_info:
      libraries openblas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']
      NOT AVAILABLE

    lapack_mkl_info:
      libraries mkl_rt not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']
      NOT AVAILABLE

    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
    C:\Python27\lib\site-packages\numpy\distutils\system_info.py:639: UserWarning: Specified path C:\projects\numpy-wheels\windows-wheel-builder\atlas-builds\atlas-3.10.1-sse2-32\lib is invalid.
      warnings.warn('Specified path %s is invalid.' % d)
    <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:\Python27\lib\site-packages\numpy\distutils\system_info.py:1532: 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:1543: 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:1546: 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.
    non-existing path in 'scipy\\integrate': 'quadpack.h'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\loba3\appdata\local\temp\pip-build-9_n1ir\scipy\setup.py", line 416, in <module>
        setup_package()
      File "c:\users\loba3\appdata\local\temp\pip-build-9_n1ir\scipy\setup.py", line 412, in setup_package
        setup(**metadata)
      File "C:\Python27\lib\site-packages\numpy\distutils\core.py", line 135, in setup
        config = configuration()
      File "c:\users\loba3\appdata\local\temp\pip-build-9_n1ir\scipy\setup.py", line 336, in configuration
        config.add_subpackage('scipy')
      File "C:\Python27\lib\site-packages\numpy\distutils\misc_util.py", line 1000, in add_subpackage
        caller_level = 2)
      File "C:\Python27\lib\site-packages\numpy\distutils\misc_util.py", line 969, in get_subpackage
        caller_level = caller_level + 1)
      File "C:\Python27\lib\site-packages\numpy\distutils\misc_util.py", line 906, 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 1000, in add_subpackage
        caller_level = 2)
      File "C:\Python27\lib\site-packages\numpy\distutils\misc_util.py", line 969, in get_subpackage
        caller_level = caller_level + 1)
      File "C:\Python27\lib\site-packages\numpy\distutils\misc_util.py", line 906, 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\\loba3\\appdata\\local\\temp\\pip-build-9_n1ir\\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\loba3\appdata\local\temp\pip-vxgx6l-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\loba3\appdata\local\temp\pip-build-9_n1ir\scipy\

类似安装: pip3 安装 scipy 产生:

C:\Users\loba3>pip3 install scipy
Collecting scipy
  Using cached scipy-0.19.0.zip
Building wheels for collected packages: scipy
  Running setup.py bdist_wheel for scipy ... error
  Complete output from command c:\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\loba3\\AppData\\Local\\Temp\\pip-build-0xe2tade\\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\loba3\AppData\Local\Temp\tmppxe32c39pip-wheel- --python-tag cp36:
  lapack_opt_info:
  lapack_mkl_info:
    libraries mkl_rt not found in ['c:\\python36-32\\lib', 'C:\\', 'c:\\python36-32\\libs']
    NOT AVAILABLE

  openblas_lapack_info:
    libraries openblas not found in ['c:\\python36-32\\lib', 'C:\\', 'c:\\python36-32\\libs']
    NOT AVAILABLE

  atlas_3_10_threads_info:
  Setting PTATLAS=ATLAS
  c:\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:\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:\\python36-32\\lib', 'C:\\', 'c:\\python36-32\\libs']
    NOT AVAILABLE

  c:\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:\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\loba3\AppData\Local\Temp\pip-build-0xe2tade\scipy\setup.py", line 416, in <module>
      setup_package()
    File "C:\Users\loba3\AppData\Local\Temp\pip-build-0xe2tade\scipy\setup.py", line 412, in setup_package
      setup(**metadata)
    File "c:\python36-32\lib\site-packages\numpy\distutils\core.py", line 135, in setup
      config = configuration()
    File "C:\Users\loba3\AppData\Local\Temp\pip-build-0xe2tade\scipy\setup.py", line 336, in configuration
      config.add_subpackage('scipy')
    File "c:\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 1001, in add_subpackage
      caller_level = 2)
    File "c:\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 970, in get_subpackage
      caller_level = caller_level + 1)
    File "c:\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 907, 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:\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 1001, in add_subpackage
      caller_level = 2)
    File "c:\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 970, in get_subpackage
      caller_level = caller_level + 1)
    File "c:\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 907, 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:\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\loba3\\AppData\\Local\\Temp\\pip-build-0xe2tade\\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:\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\loba3\\AppData\\Local\\Temp\\pip-build-0xe2tade\\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\loba3\AppData\Local\Temp\pip-xbbmy91e-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:\\python36-32\\lib', 'C:\\', 'c:\\python36-32\\libs']
      NOT AVAILABLE

    openblas_lapack_info:
      libraries openblas not found in ['c:\\python36-32\\lib', 'C:\\', 'c:\\python36-32\\libs']
      NOT AVAILABLE

    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
    c:\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:\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:\\python36-32\\lib', 'C:\\', 'c:\\python36-32\\libs']
      NOT AVAILABLE

    c:\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:\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\loba3\AppData\Local\Temp\pip-build-0xe2tade\scipy\setup.py", line 416, in <module>
        setup_package()
      File "C:\Users\loba3\AppData\Local\Temp\pip-build-0xe2tade\scipy\setup.py", line 412, in setup_package
        setup(**metadata)
      File "c:\python36-32\lib\site-packages\numpy\distutils\core.py", line 135, in setup
        config = configuration()
      File "C:\Users\loba3\AppData\Local\Temp\pip-build-0xe2tade\scipy\setup.py", line 336, in configuration
        config.add_subpackage('scipy')
      File "c:\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 1001, in add_subpackage
        caller_level = 2)
      File "c:\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 970, in get_subpackage
        caller_level = caller_level + 1)
      File "c:\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 907, 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:\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 1001, in add_subpackage
        caller_level = 2)
      File "c:\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 970, in get_subpackage
        caller_level = caller_level + 1)
      File "c:\python36-32\lib\site-packages\numpy\distutils\misc_util.py", line 907, 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:\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\loba3\\AppData\\Local\\Temp\\pip-build-0xe2tade\\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\loba3\AppData\Local\Temp\pip-xbbmy91e-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\loba3\AppData\Local\Temp\pip-build-0xe2tade\scipy\

我也试过安装numpy+mlk

C:\Python27\toinstall>python -m pip install numpy-1.11.3+mkl-cp27-cp27m-win_amd64.whl
numpy-1.11.3+mkl-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.

但它不会让我安装

From this post 我已经安装了 minGW 并将其添加到我的路径中。安装 SciPy 仍然会抛出错误。

请帮帮我

编辑: 我在 64 位系统上运行。 python 2.7 但是,当我尝试在 python 3.6 中安装时显示相同的错误

编辑: WTF 我尝试了 32 位版本 scipy‑0.19.0‑cp27‑cp27m‑win32.whl 并且它工作......但是当我在 Windows 中到达 system 时它说我有一个 64 位系统

【问题讨论】:

  • 你用的是什么版本的python?你的电脑是 32 位还是 64 位机器?
  • 对于这类问题也投入了大量时间的人,将其他库安装到 anaconda python 解释器中不是更容易吗?
  • 日志很清楚:您需要安装 BLAS 和 LAPACK 库。

标签: python numpy scipy


【解决方案1】:

由于安装scipy 包需要预先安装许多其他依赖项才能安装,您可以阅读 scipy 网站上提到的here。

解决您的问题:

方法一:

使用来自Christoph Gohlke 站点的预构建 scipy 库

安装 .whl 文件只需要 pip

pip install PATH_TO_whl_FILE 就完成了。

方法二:

您可以简单地使用Anaconda,它附带了许多科学库,包括 scipy、matplotlib 等。所有您可能需要的东西

【讨论】:

    【解决方案2】:

    pip 的另一种选择是使用conda,所以你可以试试:

    conda install -c anaconda scipy=0.19.0

    但通常你应该可以直接从pip安装

    python -m pip install --upgrade pip
    pip install scipy
    

    您可以在此处找到更多信息: https://www.scipy.org/install.html

    【讨论】:

      【解决方案3】:

      这可能是因为您的点子太旧了。升级 pip 并尝试再次安装 scipy。

      pip install --upgrade pip
      pip install scipy
      

      【讨论】:

      • 我在 Interner 上看到了很多解决方案,但是,我这是唯一的解决方案
      【解决方案4】:

      不要在 Windows 上编译 Scipy,只需使用预编译的轮子。您可以在此处找到它以及许多其他用于 Windows 的预编译包:http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy

      另外,请尽量不要使用 Python 2.7,它不会变得更年轻。使用 Python 3。

      【讨论】:

        【解决方案5】:

        只是添加到列表中:

        我在处理需要scipy==0.17.1 的旧 Python 2.7 项目时遇到了同样的问题。通过 conda 安装 scipy 确实有效,但我需要从需求文件中安装“纯”pip。

        在搜索解决方案一小时后,发现最新的scipy 版本(在我的情况下为scipy 1.1.0)在 Windows 10 上使用 pip 安装没有问题(并且适用于我的项目..)。

        【讨论】:

          猜你喜欢
          • 2017-05-07
          • 2017-09-14
          • 2015-12-08
          • 1970-01-01
          • 2013-11-25
          • 1970-01-01
          • 2012-09-19
          • 2013-08-19
          • 2016-12-27
          相关资源
          最近更新 更多