安装熊猫时,如何解决Visual C ++错误?

时间:2020-06-11 00:57:45

标签: python python-3.x pandas pip

尝试在PyCharm中安装熊猫后,我遇到以下错误并感到困惑:

“错误:需要Microsoft Visual C ++ 14.0。使用“ Microsoft Visual C ++生成工具”获取它:https://visualstudio.microsoft.com/downloads/

我的解释器是Python 3.8

这很奇怪,尤其是因为我已经安装了Visual Studio Community 2019东西,并且选择了所有内容以及我在Youtube视频中看到的npm开发人员Github。我已经重新启动计算机,但它仍然无法正常工作,因此此刻我很困惑。

这是命令输出:

>Collecting pandas
  Using cached https://files.pythonhosted.org/packages/53/87/6438c197fc70ca6b3056cfb60b3dfedca25bedb631bce1f72d6a10502d15/pandas-1.0.4.tar.gz
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  Complete output from command C:\Users\Asus\PycharmProjects\excel_diff\venv\Scripts\python.exe C:\Users\Asus\PycharmProjects\excel_diff\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip install --ignore-installed --no-user --prefix C:\Users\Asus\AppData\Local\Temp\pip-build-env-s4mphotd\overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel Cython>=0.29.13 "numpy==1.13.3; python_version=='3.6' and platform_system!='AIX'" "numpy==1.14.5; python_version>='3.7' and platform_system!='AIX'" "numpy==1.16.0; python_version=='3.6' and platform_system=='AIX'" "numpy==1.16.0; python_version>='3.7' and platform_system=='AIX'":
  Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.6" and platform_system == "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version >= "3.7" and platform_system == "AIX"' don't match your environment
  Collecting setuptools
    Using cached https://files.pythonhosted.org/packages/95/95/f657b6e17f00c3f35b5f68b10e46c3a43af353d8856bd57bfcfb1dbb3e92/setuptools-47.1.1-py3-none-any.whl
  Collecting wheel
    Using cached https://files.pythonhosted.org/packages/8c/23/848298cccf8e40f5bbb59009b32848a4c38f4e7f3364297ab3c3e2e2cd14/wheel-0.34.2-py2.py3-none-any.whl
  Collecting Cython>=0.29.13
    Using cached https://files.pythonhosted.org/packages/1e/2a/fcb9cf3620a758bc7a1bd4a02eb00722661a658bf9de053894c4dc77596c/Cython-0.29.20-py2.py3-none-any.whl
  Collecting numpy==1.14.5
    Using cached https://files.pythonhosted.org/packages/d5/6e/f00492653d0fdf6497a181a1c1d46bbea5a2383e7faf4c8ca6d6f3d2581d/numpy-1.14.5.zip
  Installing collected packages: setuptools, wheel, Cython, numpy
    Running setup.py install for numpy: started
      Running setup.py install for numpy: finished with status 'error'
      Complete output from command C:\Users\Asus\PycharmProjects\excel_diff\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Asus\\AppData\\Local\\Temp\\pip-install-voa_csp7\\numpy\\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\Asus\AppData\Local\Temp\pip-record-x0lvewbh\install-record.txt --single-version-externally-managed --prefix C:\Users\Asus\AppData\Local\Temp\pip-build-env-s4mphotd\overlay --compile --install-headers C:\Users\Asus\PycharmProjects\excel_diff\venv\include\site\python3.8\numpy:
      Running from numpy source directory.

      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 numpy`   (last NumPy release on PyPi)


      C:\Users\Asus\AppData\Local\Temp\pip-install-voa_csp7\numpy\numpy\distutils\misc_util.py:464: SyntaxWarning: "is" with a literal. Did you mean "=="?
        return is_string(s) and ('*' in s or '?' is s)
      blas_opt_info:
      blas_mkl_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries mkl_rt not found in ['C:\\Users\\Asus\\PycharmProjects\\excel_diff\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      blis_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries blis not found in ['C:\\Users\\Asus\\PycharmProjects\\excel_diff\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      openblas_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\\Asus\\PycharmProjects\\excel_diff\\venv\\lib', 'C:\\']
      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

      atlas_3_10_blas_threads_info:
      Setting PTATLAS=ATLAS
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries tatlas not found in ['C:\\Users\\Asus\\PycharmProjects\\excel_diff\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      atlas_3_10_blas_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries satlas not found in ['C:\\Users\\Asus\\PycharmProjects\\excel_diff\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      atlas_blas_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\\Asus\\PycharmProjects\\excel_diff\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      atlas_blas_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries f77blas,cblas,atlas not found in ['C:\\Users\\Asus\\PycharmProjects\\excel_diff\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      C:\Users\Asus\AppData\Local\Temp\pip-install-voa_csp7\numpy\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()
      blas_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries blas not found in ['C:\\Users\\Asus\\PycharmProjects\\excel_diff\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      C:\Users\Asus\AppData\Local\Temp\pip-install-voa_csp7\numpy\numpy\distutils\system_info.py:624: UserWarning:
          Blas (http://www.netlib.org/blas/) libraries not found.
          Directories to search for the libraries can be specified in the
          numpy/distutils/site.cfg file (section [blas]) or by setting
          the BLAS environment variable.
        self.calc_info()
      blas_src_info:
        NOT AVAILABLE

      C:\Users\Asus\AppData\Local\Temp\pip-install-voa_csp7\numpy\numpy\distutils\system_info.py:624: UserWarning:
          Blas (http://www.netlib.org/blas/) sources not found.
          Directories to search for the sources can be specified in the
          numpy/distutils/site.cfg file (section [blas_src]) or by setting
          the BLAS_SRC environment variable.
        self.calc_info()
        NOT AVAILABLE

      'svnversion' is not recognized as an internal or external command,
      operable program or batch file.
      'svnversion' is not recognized as an internal or external command,
      operable program or batch file.
      non-existing path in 'numpy\\distutils': 'site.cfg'
      F2PY Version 2
      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\\Asus\\PycharmProjects\\excel_diff\\venv\\lib', 'C:\\']
        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\\Asus\\PycharmProjects\\excel_diff\\venv\\lib', 'C:\\']
        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\\Asus\\PycharmProjects\\excel_diff\\venv\\lib', 'C:\\']
        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\Asus\PycharmProjects\excel_diff\venv\lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\Users\Asus\PycharmProjects\excel_diff\venv\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:\
      <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\Asus\PycharmProjects\excel_diff\venv\lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\Users\Asus\PycharmProjects\excel_diff\venv\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:\
      <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\Asus\PycharmProjects\excel_diff\venv\lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\Users\Asus\PycharmProjects\excel_diff\venv\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:\
      <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\Asus\PycharmProjects\excel_diff\venv\lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\Users\Asus\PycharmProjects\excel_diff\venv\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:\
      <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\\Asus\\PycharmProjects\\excel_diff\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      C:\Users\Asus\AppData\Local\Temp\pip-install-voa_csp7\numpy\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()
      lapack_src_info:
        NOT AVAILABLE

      C:\Users\Asus\AppData\Local\Temp\pip-install-voa_csp7\numpy\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()
        NOT AVAILABLE

      C:\Users\Asus\AppData\Local\Programs\Python\Python38-32\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
        warnings.warn(msg)
      running install
      running build
      running config_cc
      unifing config_cc, config, build_clib, build_ext, build commands --compiler options
      running config_fc
      unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
      running build_src
      build_src
      building py_modules sources
      creating build
      creating build\src.win32-3.8
      creating build\src.win32-3.8\numpy
      creating build\src.win32-3.8\numpy\distutils
      building library "npymath" sources
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

      ----------------------------------------
  Command "C:\Users\Asus\PycharmProjects\excel_diff\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Asus\\AppData\\Local\\Temp\\pip-install-voa_csp7\\numpy\\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\Asus\AppData\Local\Temp\pip-record-x0lvewbh\install-record.txt --single-version-externally-managed --prefix C:\Users\Asus\AppData\Local\Temp\pip-build-env-s4mphotd\overlay --compile --install-headers C:\Users\Asus\PycharmProjects\excel_diff\venv\include\site\python3.8\numpy" failed with error code 1 in C:\Users\Asus\AppData\Local\Temp\pip-install-voa_csp7\numpy\

  ----------------------------------------

Command "C:\Users\Asus\PycharmProjects\excel_diff\venv\Scripts\python.exe C:\Users\Asus\PycharmProjects\excel_diff\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip install --ignore-installed --no-user --prefix C:\Users\Asus\AppData\Local\Temp\pip-build-env-s4mphotd\overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel Cython>=0.29.13 "numpy==1.13.3; python_version=='3.6' and platform_system!='AIX'" "numpy==1.14.5; python_version>='3.7' and platform_system!='AIX'" "numpy==1.16.0; python_version=='3.6' and platform_system=='AIX'" "numpy==1.16.0; python_version>='3.7' and platform_system=='AIX'"" failed with error code 1 in None




EDIT: SOLVED by downloading Build Tools as suggested by comment

1 个答案:

答案 0 :(得分:0)

您缺少C ++编译器来编译numpy

这是official link to download,并安装Microsoft Visual C ++生成工具。安装该软件,重新启动PC,然后再次尝试安装numpy