繁体   English   中英

无法使用 pip 安装某些 python 包

[英]Cannot Install certain python packages using pip

所以我一直在尝试进入机器学习,我发现这个教程告诉我要获得以下 python 包:

  • scipy
  • numpy
  • matplotlib
  • pandas
  • sklearn

现在的问题是,只有 numpy 和 pandas 会安装。 其他人给我这些错误,它们很长,我不明白

C:\Users>python -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose sklearn
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Users>py -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose sklearn
Requirement already satisfied: numpy in c:\users\shena\appdata\roaming\python\python38\site-packages (1.17.3)
Collecting scipy
  Using cached https://files.pythonhosted.org/packages/ee/5b/5afcd1c46f97b3c2ac3489dbc95d6ca28eacf8e3634e51f495da68d97f0f/scipy-1.3.1.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\shena\AppData\Local\Programs\Python\Python38\python.exe' 'C:\Users\shena\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\shena\AppData\Local\Temp\tmpkc2te07r'
         cwd: C:\Users\shena\AppData\Local\Temp\pip-install-tzg_6_4x\scipy
    Complete output (192 lines):
    lapack_opt_info:
    lapack_mkl_info:
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries mkl_rt not found in ['C:\\Users\\shena\\AppData\\Local\\Programs\\Python\\Python38\\lib', 'C:\\', 'C:\\Users\\shena\\AppData\\Local\\Programs\\Python\\Python38\\libs']
      NOT AVAILABLE

    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\\shena\\AppData\\Local\\Programs\\Python\\Python38\\lib', 'C:\\', 'C:\\Users\\shena\\AppData\\Local\\Programs\\Python\\Python38\\libs']
    get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
    customize GnuFCompiler
    Could not locate executable g77
    Could not locate executable f77
    customize IntelVisualFCompiler
    Could not locate executable ifort
    Could not locate executable ifl
    customize AbsoftFCompiler
    Could not locate executable f90
    customize CompaqVisualFCompiler
    Could not locate executable DF
    customize IntelItaniumVisualFCompiler
    Could not locate executable efl
    customize Gnu95FCompiler
    Could not locate executable gfortran
    Could not locate executable f95
    customize G95FCompiler
    Could not locate executable g95
    customize IntelEM64VisualFCompiler
    customize IntelEM64TFCompiler
    Could not locate executable efort
    Could not locate executable efc
    customize PGroupFlangCompiler
    Could not locate executable flang
    don't know how to compile Fortran code on platform 'nt'
      NOT AVAILABLE

    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\\shena\\AppData\\Local\\Programs\\Python\\Python38\\lib', 'C:\\', 'C:\\Users\\shena\\AppData\\Local\\Programs\\Python\\Python38\\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 tatlas,tatlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\lib
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\lib
    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:\
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries tatlas,tatlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\libs
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\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 satlas,satlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\lib
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\lib
    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:\
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries satlas,satlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\libs
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\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 ptf77blas,ptcblas,atlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\lib
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\lib
    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:\
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries ptf77blas,ptcblas,atlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\libs
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\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 f77blas,cblas,atlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\lib
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\lib
    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:\
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries f77blas,cblas,atlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\libs
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\Users\shena\AppData\Local\Programs\Python\Python38\libs
    <class 'numpy.distutils.system_info.atlas_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\\shena\\AppData\\Local\\Programs\\Python\\Python38\\lib', 'C:\\', 'C:\\Users\\shena\\AppData\\Local\\Programs\\Python\\Python38\\libs']
      NOT AVAILABLE

    lapack_src_info:
      NOT AVAILABLE

      NOT AVAILABLE

    setup.py:386: UserWarning: Unrecognized setuptools command ('dist_info --egg-base C:\Users\shena\AppData\Local\Temp\pip-modern-metadata-2q62p6et'), proceeding with generating Cython sources and expanding templates
      warnings.warn("Unrecognized setuptools command ('{}'), proceeding with "
    Running from scipy source directory.
    C:\Users\shena\AppData\Local\Temp\pip-build-env-08osdz6n\overlay\Lib\site-packages\numpy\distutils\system_info.py:624: 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()
    C:\Users\shena\AppData\Local\Temp\pip-build-env-08osdz6n\overlay\Lib\site-packages\numpy\distutils\system_info.py:624: 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()
    C:\Users\shena\AppData\Local\Temp\pip-build-env-08osdz6n\overlay\Lib\site-packages\numpy\distutils\system_info.py:624: 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()
    Traceback (most recent call last):
      File "C:\Users\shena\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 257, in <module>
        main()
      File "C:\Users\shena\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 240, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "C:\Users\shena\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 110, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "C:\Users\shena\AppData\Local\Temp\pip-build-env-08osdz6n\overlay\Lib\site-packages\setuptools\build_meta.py", line 156, in prepare_metadata_for_build_wheel
        self.run_setup()
      File "C:\Users\shena\AppData\Local\Temp\pip-build-env-08osdz6n\overlay\Lib\site-packages\setuptools\build_meta.py", line 236, in run_setup
        super(_BuildMetaLegacyBackend,
      File "C:\Users\shena\AppData\Local\Temp\pip-build-env-08osdz6n\overlay\Lib\site-packages\setuptools\build_meta.py", line 142, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 505, in <module>
        setup_package()
      File "setup.py", line 501, in setup_package
        setup(**metadata)
      File "C:\Users\shena\AppData\Local\Temp\pip-build-env-08osdz6n\overlay\Lib\site-packages\numpy\distutils\core.py", line 135, in setup
        config = configuration()
      File "setup.py", line 403, in configuration
        raise NotFoundError(msg)
    numpy.distutils.system_info.NotFoundError: No lapack/blas resources found.
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\shena\AppData\Local\Programs\Python\Python38\python.exe' 'C:\Users\shena\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\shena\AppData\Local\Temp\tmpkc2te07r' Check the logs for full command output.

使用 Python 时请考虑使用 Anaconda 管理包。 链接: https://docs.conda.io/projects/conda/en/latest/user-guide/install/windows.html

虽然学习一个新工具可能看起来令人生畏,但相信我,这是通往 go 的正确方法,将大大简化您的生活。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM