在windows上安装scipy的问题



我之前安装了scipy, numpy和scikit-learn,它们都工作得很好。今天,我用pip安装更新了所有的库。Numpy和scikit-learn更新到最新版本,但scipy有编译问题,被回滚。

当我尝试

from sklearn.ensemble import RandomForestClassifier

ImportError: No module named 'format'

我试图解决这个问题,但它对我不起作用。

所以,我卸载了scipy,这样我就可以重新安装而不会出现任何错误。我不能这样做。

当我尝试pip install scipy

Failed building wheel for scipy

这是跟踪:

Collecting scipy
  Using cached scipy-0.16.0.tar.gz
Building wheels for collected packages: scipy
  Running setup.py bdist_wheel for scipy
  Complete output from command c:usersxxxanaconda3python.exe -c "import setuptools;__file__='C:\Users\xxx\AppData\Local\Temp\pip-build-fqlt6je0\scipy\setup.py';exec(compile(open(__file__).read().replace('rn', 'n'), __file__, 'exec'))" bdist_wheel -d C:UsersxxxAppDataLocalTemptmpnacedj77pip-wheel-:
  lapack_opt_info:
  openblas_lapack_info:
    libraries openblas not found in ['c:\users\xxx\anaconda3\lib', 'C:\', 'c:\users\xxx\anaconda3\libs']
    NOT AVAILABLE
  lapack_mkl_info:
  mkl_info:
    libraries mkl_lapack95_lp64,mkl_blas95_lp64,mkl_intel_lp64,mkl_intel_thread,mkl_core,libiomp5md,libifportmd not found in []
    NOT AVAILABLE
    NOT AVAILABLE
  atlas_3_10_threads_info:
  Setting PTATLAS=ATLAS
    libraries tatlas,tatlas not found in c:usersxxxanaconda3lib
    libraries lapack_atlas not found in c:usersxxxanaconda3lib
    libraries tatlas,tatlas not found in C:
    libraries lapack_atlas not found in C:
    libraries tatlas,tatlas not found in c:usersxxxanaconda3libs
    libraries lapack_atlas not found in c:usersxxxanaconda3libs
  <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
    NOT AVAILABLE
  atlas_3_10_info:
    libraries satlas,satlas not found in c:usersxxxanaconda3lib
    libraries lapack_atlas not found in c:usersxxxanaconda3lib
    libraries satlas,satlas not found in C:
    libraries lapack_atlas not found in C:
    libraries satlas,satlas not found in c:usersxxxanaconda3libs
    libraries lapack_atlas not found in c:usersxxxanaconda3libs
  <class 'numpy.distutils.system_info.atlas_3_10_info'>
    NOT AVAILABLE
  atlas_threads_info:
  Setting PTATLAS=ATLAS
    libraries ptf77blas,ptcblas,atlas not found in c:usersxxxanaconda3lib
    libraries lapack_atlas not found in c:usersxxxanaconda3lib
    libraries ptf77blas,ptcblas,atlas not found in C:
    libraries lapack_atlas not found in C:
    libraries ptf77blas,ptcblas,atlas not found in c:usersxxxanaconda3libs
    libraries lapack_atlas not found in c:usersxxxanaconda3libs
  <class 'numpy.distutils.system_info.atlas_threads_info'>
    NOT AVAILABLE
  atlas_info:
    libraries f77blas,cblas,atlas not found in c:usersxxxanaconda3lib
    libraries lapack_atlas not found in c:usersxxxanaconda3lib
    libraries f77blas,cblas,atlas not found in C:
    libraries lapack_atlas not found in C:
    libraries f77blas,cblas,atlas not found in c:usersxxxanaconda3libs
    libraries lapack_atlas not found in c:usersxxxanaconda3libs
  <class 'numpy.distutils.system_info.atlas_info'>
    NOT AVAILABLE
  lapack_info:
    libraries lapack not found in ['c:\users\xxx\anaconda3\lib', 'C:\', 'c:\users\xxx\anaconda3\libs']
    NOT AVAILABLE
  lapack_src_info:
    NOT AVAILABLE
    NOT AVAILABLE
  c:usersxxxanaconda3libsite-packagesnumpydistutilssystem_info.py:594: UserWarning: Specified path C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64 is invalid.
    warnings.warn('Specified path %s is invalid.' % d)
  c:usersxxxanaconda3libsite-packagesnumpydistutilssystem_info.py:594: UserWarning: Specified path C:/Program Files (x86)/Intel/Composer XE/compiler/lib/intel64 is invalid.
    warnings.warn('Specified path %s is invalid.' % d)
  c:usersxxxanaconda3libsite-packagesnumpydistutilssystem_info.py:594: UserWarning: Specified path C:/Program Files (x86)/Intel/Composer XE/mkl/include is invalid.
    warnings.warn('Specified path %s is invalid.' % d)
  c:usersxxxanaconda3libsite-packagesnumpydistutilssystem_info.py:1505: 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__)
  c:usersxxxanaconda3libsite-packagesnumpydistutilssystem_info.py:1516: 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__)
  c:usersxxxanaconda3libsite-packagesnumpydistutilssystem_info.py:1519: 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__)
  Running from scipy source directory.
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:UsersxxxAppDataLocalTemppip-build-fqlt6je0scipysetup.py", line 253, in <module>
      setup_package()
    File "C:UsersxxxAppDataLocalTemppip-build-fqlt6je0scipysetup.py", line 250, in setup_package
      setup(**metadata)
    File "c:usersxxxanaconda3libsite-packagesnumpydistutilscore.py", line 135, in setup
      config = configuration()
    File "C:UsersxxxAppDataLocalTemppip-build-fqlt6je0scipysetup.py", line 175, in configuration
      config.add_subpackage('scipy')
    File "c:usersxxxanaconda3libsite-packagesnumpydistutilsmisc_util.py", line 966, in add_subpackage
      caller_level = 2)
    File "c:usersxxxanaconda3libsite-packagesnumpydistutilsmisc_util.py", line 935, in get_subpackage
      caller_level = caller_level + 1)
    File "c:usersxxxanaconda3libsite-packagesnumpydistutilsmisc_util.py", line 872, in _get_configuration_from_setup_py
      config = setup_module.configuration(*args)
    File "scipysetup.py", line 15, in configuration
      config.add_subpackage('linalg')
    File "c:usersxxxanaconda3libsite-packagesnumpydistutilsmisc_util.py", line 966, in add_subpackage
      caller_level = 2)
    File "c:usersxxxanaconda3libsite-packagesnumpydistutilsmisc_util.py", line 935, in get_subpackage
      caller_level = caller_level + 1)
    File "c:usersxxxanaconda3libsite-packagesnumpydistutilsmisc_util.py", line 872, in _get_configuration_from_setup_py
      config = setup_module.configuration(*args)
    File "scipylinalgsetup.py", line 19, in configuration
      raise NotFoundError('no lapack/blas resources found')
  numpy.distutils.system_info.NotFoundError: no lapack/blas resources found
  ----------------------------------------
  Failed building wheel for scipy
Failed to build scipy
Installing collected packages: scipy
  Running setup.py install for scipy
    Complete output from command c:usersxxxanaconda3python.exe -c "import setuptools, tokenize;__file__='C:\Users\xxx\AppData\Local\Temp\pip-build-fqlt6je0\scipy\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record C:UsersxxxAppDataLocalTemppip-garwperl-recordinstall-record.txt --single-version-externally-managed --compile:
    lapack_opt_info:
    openblas_lapack_info:
      libraries openblas not found in ['c:\users\xxx\anaconda3\lib', 'C:\', 'c:\users\xxx\anaconda3\libs']
      NOT AVAILABLE
    lapack_mkl_info:
    mkl_info:
      libraries mkl_lapack95_lp64,mkl_blas95_lp64,mkl_intel_lp64,mkl_intel_thread,mkl_core,libiomp5md,libifportmd not found in []
      NOT AVAILABLE
      NOT AVAILABLE
    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
      libraries tatlas,tatlas not found in c:usersxxxanaconda3lib
      libraries lapack_atlas not found in c:usersxxxanaconda3lib
      libraries tatlas,tatlas not found in C:
      libraries lapack_atlas not found in C:
      libraries tatlas,tatlas not found in c:usersxxxanaconda3libs
      libraries lapack_atlas not found in c:usersxxxanaconda3libs
    <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
      NOT AVAILABLE
    atlas_3_10_info:
      libraries satlas,satlas not found in c:usersxxxanaconda3lib
      libraries lapack_atlas not found in c:usersxxxanaconda3lib
      libraries satlas,satlas not found in C:
      libraries lapack_atlas not found in C:
      libraries satlas,satlas not found in c:usersxxxanaconda3libs
      libraries lapack_atlas not found in c:usersxxxanaconda3libs
    <class 'numpy.distutils.system_info.atlas_3_10_info'>
      NOT AVAILABLE
    atlas_threads_info:
    Setting PTATLAS=ATLAS
      libraries ptf77blas,ptcblas,atlas not found in c:usersxxxanaconda3lib
      libraries lapack_atlas not found in c:usersxxxanaconda3lib
      libraries ptf77blas,ptcblas,atlas not found in C:
      libraries lapack_atlas not found in C:
      libraries ptf77blas,ptcblas,atlas not found in c:usersxxxanaconda3libs
      libraries lapack_atlas not found in c:usersxxxanaconda3libs
    <class 'numpy.distutils.system_info.atlas_threads_info'>
      NOT AVAILABLE
    atlas_info:
      libraries f77blas,cblas,atlas not found in c:usersxxxanaconda3lib
      libraries lapack_atlas not found in c:usersxxxanaconda3lib
      libraries f77blas,cblas,atlas not found in C:
      libraries lapack_atlas not found in C:
      libraries f77blas,cblas,atlas not found in c:usersxxxanaconda3libs
      libraries lapack_atlas not found in c:usersxxxanaconda3libs
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE
    lapack_info:
      libraries lapack not found in ['c:\users\xxx\anaconda3\lib', 'C:\', 'c:\users\xxx\anaconda3\libs']
      NOT AVAILABLE
    lapack_src_info:
      NOT AVAILABLE
      NOT AVAILABLE
    c:usersxxxanaconda3libsite-packagesnumpydistutilssystem_info.py:594: UserWarning: Specified path C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64 is invalid.
      warnings.warn('Specified path %s is invalid.' % d)
    c:usersxxxanaconda3libsite-packagesnumpydistutilssystem_info.py:594: UserWarning: Specified path C:/Program Files (x86)/Intel/Composer XE/compiler/lib/intel64 is invalid.
      warnings.warn('Specified path %s is invalid.' % d)
    c:usersxxxanaconda3libsite-packagesnumpydistutilssystem_info.py:594: UserWarning: Specified path C:/Program Files (x86)/Intel/Composer XE/mkl/include is invalid.
      warnings.warn('Specified path %s is invalid.' % d)
    c:usersxxxanaconda3libsite-packagesnumpydistutilssystem_info.py:1505: 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__)
    c:usersxxxanaconda3libsite-packagesnumpydistutilssystem_info.py:1516: 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__)
    c:usersxxxanaconda3libsite-packagesnumpydistutilssystem_info.py:1519: 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__)
    Running from scipy source directory.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:UsersxxxAppDataLocalTemppip-build-fqlt6je0scipysetup.py", line 253, in <module>
        setup_package()
      File "C:UsersxxxAppDataLocalTemppip-build-fqlt6je0scipysetup.py", line 250, in setup_package
        setup(**metadata)
      File "c:usersxxxanaconda3libsite-packagesnumpydistutilscore.py", line 135, in setup
        config = configuration()
      File "C:UsersxxxAppDataLocalTemppip-build-fqlt6je0scipysetup.py", line 175, in configuration
        config.add_subpackage('scipy')
      File "c:usersxxxanaconda3libsite-packagesnumpydistutilsmisc_util.py", line 966, in add_subpackage
        caller_level = 2)
      File "c:usersxxxanaconda3libsite-packagesnumpydistutilsmisc_util.py", line 935, in get_subpackage
        caller_level = caller_level + 1)
      File "c:usersxxxanaconda3libsite-packagesnumpydistutilsmisc_util.py", line 872, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "scipysetup.py", line 15, in configuration
        config.add_subpackage('linalg')
      File "c:usersxxxanaconda3libsite-packagesnumpydistutilsmisc_util.py", line 966, in add_subpackage
        caller_level = 2)
      File "c:usersxxxanaconda3libsite-packagesnumpydistutilsmisc_util.py", line 935, in get_subpackage
        caller_level = caller_level + 1)
      File "c:usersxxxanaconda3libsite-packagesnumpydistutilsmisc_util.py", line 872, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "scipylinalgsetup.py", line 19, in configuration
        raise NotFoundError('no lapack/blas resources found')
    numpy.distutils.system_info.NotFoundError: no lapack/blas resources found
    ----------------------------------------
Command "c:usersxxxanaconda3python.exe -c "import setuptools, tokenize;__file__='C:\Users\xxx\AppData\Local\Temp\pip-build-fqlt6je0\scipy\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record C:UsersxxxAppDataLocalTemppip-garwperl-recordinstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:UsersxxxAppDataLocalTemppip-build-fqlt6je0scipy

我看到图书馆的blas和lapack都不见了。有一个更简单的方法来解决我的错误,而不是从安装程序。我得找BLAS, LAPACK, ATLAS。

关于为什么我面临这个问题的任何输入,当我试图更新时,库文件被删除了吗?

谢谢!

在Windows操作系统下,使用pip安装scipy可能会出现问题。如果您正在运行anaconda,您可以尝试评论中的建议:

conda install scipy

或者你可以尝试从这里下载最新的scipy的Windows版本:

用于Python扩展包的非官方Windows二进制文件作者:Christoph Gohlke,加州大学欧文分校荧光动力学实验室

然后使用pip安装下载的.whl文件

相关内容

  • 没有找到相关文章