(Python / VS代码)无法安装scipy

时间:2020-10-16 17:50:37

标签: python visual-studio-code scipy

我似乎无法使用VS Code安装scipy。

python -m pip安装scipy 收集科学 使用缓存的scipy-1.5.2.tar.gz(25.4 MB) 安装构建依赖项...完成 完成构建车轮的要求...完成 正在准备车轮元数据...错误 错误:命令错误,退出状态为1: 命令:'C:\ Users \ bundyjas \ AppData \ Local \ Programs \ Python \ Python39 \ python.exe''C:\ Users \ bundyjas \ AppData \ Local \ Programs \ Python \ Python39 \ lib \ site \ packages \ pip_vendor \ pep517_in_process.py'prepare_metadata_for_build_wheel'C:\ Users \ bundyjas \ AppData \ Local \ Temp \ tmpmkxabgvf' CWD:C:\ Users \ bundyjas \ AppData \ Local \ Temp \ pip-install-4lff1348 \ scipy 完整输出(195行): setup.py:460:用户警告:无法识别的setuptools命令('dist_info --egg-base C:\ Users \ bundyjas \ AppData \ Local \ Temp \ pip-modern-metadata-j_sx_haa'),继续生成Cython源并扩展模板 warnings.warn(“无法识别的setuptools命令('{}'),以“ 从SciPy源目录运行。 lapack_opt_info: lapack_mkl_info: numpy.distutils中没有名为“ numpy.distutils._msvccompiler”的模块;从distutils尝试 自定义MSVCCompiler 在['C:\ Users \ bundyjas \ AppData \ Local \ Programs \ Python \ Python39 \ lib','C:\','C:\ Users \ bundyjas \ AppData \ Local \ Programs \ Python \ Python39中找不到库mkl_rt \ libs'] 不可用

openblas_lapack_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries openblas not found in ['C:\\Users\\bundyjas\\AppData\\Local\\Programs\\Python\\Python39\\lib', 'C:\\', 'C:\\Users\\bundyjas\\AppData\\Local\\Programs\\Python\\Python39\\libs']
get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 

'intelem','flang']' 自定义GnuFCompiler 找不到可执行文件g77 找不到可执行文件f77 自定义IntelVisualFCompiler 无法找到可执行文件ifort 无法找到可执行文件ifl 定制AbsoftFCompiler 找不到可执行文件f90 自定义CompaqVisualFCompiler 找不到可执行文件DF 自定义IntelItaniumVisualFCompiler 找不到可执行文件efl 定制Gnu95FCompiler 无法找到可执行文件gfortran 找不到可执行文件f95 定制G95FCompiler 找不到可执行文件g95 自定义IntelEM64VisualFCompiler 自定义IntelEM64TFCompiler 找不到可执行文件 找不到可执行文件efc 自定义PGroupFlangCompiler 无法找到可执行文件 不知道如何在平台“ nt”上编译Fortran代码 不可用

openblas_clapack_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries openblas,lapack not found in ['C:\\Users\\bundyjas\\AppData\\Local\\Programs\\Python\\Python39\\lib', 'C:\\', 'C:\\Users\\bundyjas\\AppData\\Local\\Programs\\Python\\Python39\\libs']
  NOT AVAILABLE

flame_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries flame not found in ['C:\\Users\\bundyjas\\AppData\\Local\\Programs\\Python\\Python39\\lib', 'C:\\', 'C:\\Users\\bundyjas\\AppData\\Local\\Programs\\Python\\Python39\\libs']
  NOT AVAILABLE

atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries tatlas,tatlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries tatlas,tatlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\libs
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries tatlas,tatlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\libs
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
  NOT AVAILABLE

atlas_3_10_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries satlas,satlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries satlas,satlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\libs
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries satlas,satlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\libs
<class 'numpy.distutils.system_info.atlas_3_10_info'>
  NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries ptf77blas,ptcblas,atlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries ptf77blas,ptcblas,atlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\libs
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries ptf77blas,ptcblas,atlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\libs        
<class 'numpy.distutils.system_info.atlas_threads_info'>
  NOT AVAILABLE

atlas_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries f77blas,cblas,atlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries f77blas,cblas,atlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\libs
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries f77blas,cblas,atlas not found in C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\libs
<class 'numpy.distutils.system_info.atlas_info'>
  NOT AVAILABLE

accelerate_info:
  NOT AVAILABLE

lapack_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack not found in ['C:\\Users\\bundyjas\\AppData\\Local\\Programs\\Python\\Python39\\lib', 'C:\\', 'C:\\Users\\bundyjas\\AppData\\Local\\Programs\\Python\\Python39\\libs']
  NOT AVAILABLE

C:\Users\bundyjas\AppData\Local\Temp\pip-build-env-eitrbrks\overlay\Lib\site-packages\numpy\distutils\system_info.py:1712: 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.
  if getattr(self, '_calc_info_{}'.format(lapack))():
lapack_src_info:
  NOT AVAILABLE

C:\Users\bundyjas\AppData\Local\Temp\pip-build-env-eitrbrks\overlay\Lib\site-packages\numpy\distutils\system_info.py:1712: 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.
  if getattr(self, '_calc_info_{}'.format(lapack))():
  NOT AVAILABLE

Traceback (most recent call last):
  File "C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
    main()
  File "C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "C:\Users\bundyjas\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 133, in prepare_metadata_for_build_wheel
    return hook(metadata_directory, config_settings)
  File "C:\Users\bundyjas\AppData\Local\Temp\pip-build-env-eitrbrks\overlay\Lib\site-packages\setuptools\build_meta.py", line 161, in prepare_metadata_for_build_wheel
    self.run_setup()
  File "C:\Users\bundyjas\AppData\Local\Temp\pip-build-env-eitrbrks\overlay\Lib\site-packages\setuptools\build_meta.py", line 253, in run_setup
    super(_BuildMetaLegacyBackend,
  File "C:\Users\bundyjas\AppData\Local\Temp\pip-build-env-eitrbrks\overlay\Lib\site-packages\setuptools\build_meta.py", line 145, in run_setup
    exec(compile(code, __file__, 'exec'), locals())
  File "setup.py", line 583, in <module>
    setup_package()
  File "setup.py", line 579, in setup_package
    setup(**metadata)
  File "C:\Users\bundyjas\AppData\Local\Temp\pip-build-env-eitrbrks\overlay\Lib\site-packages\numpy\distutils\core.py", line 137, in setup
    config = configuration()
  File "setup.py", line 477, in configuration
    raise NotFoundError(msg)
numpy.distutils.system_info.NotFoundError: No lapack/blas resources found.
----------------------------------------

错误:命令错误,退出状态为1:'C:\ Users \ bundyjas \ AppData \ Local \ Programs \ Python \ Python39 \ python.exe''C:\ Users \ bundyjas \ AppData \ Local \ Programs \ Python \ Python39 \ lib \ site-packages \ pip_vendor \ pep517_in_process.py'prepare_metadata_for_build_wheel'C:\ Users \ bundyjas \ AppData \ Local \ Temp \ tmpmkxabgvf'检查日志以获取完整的命令输出。

2 个答案:

答案 0 :(得分:0)

从源代码安装scipy非常困难,因此不建议这样做,尤其是在Windows上。您的日志已经表明需要C / C ++ / Fortran编译器,后者用于OpenBLAS。 (在1.0之前,有好几年没有官方二进制发布了!)

当找不到合适的预制二进制文件时(例如您的情况),就会从源代码进行安装。

这里的原因:您使用的是Python 3.9,这太新了(10月5日:现在不到2周)。 尚无正式的预制scipy版本Hint

使用Python <= 3.8。 (相信我:您不想在Windows上从源代码安装)。

(这与VS Code完全无关/正交)

答案 1 :(得分:-1)

尝试从its GitHub repo的源代码构建numpy。 另外,请查看以下GitHub问题:

  1. https://github.com/ARM-DOE/pyart/issues/869
  2. https://github.com/numpy/numpy/issues/12016

对于Could not locate executable xxx,我不确定那是什么。