出现相同错误时,如何使用pip安装任何软件包?

时间:2019-11-03 22:28:39

标签: python pip install

无论我尝试使用pip安装哪个软件包,即使安装了pip并能正常工作,我仍然遇到相同的错误。在这种情况下,我正在尝试安装seaborn,这是我得到的错误。 我必须安装Vs Build Tools,但除了现在说的没有任何变化  最初的例外是:[WinError 3]没有特殊提示:'C:\ Program Files(x86)\ Microsoft Visual Studio \ 2019 \ BuildTools \ VC \ Tools \ MSVC \ 14.23.28105 \ PlatformSDK \ lib',并且Compiler类是MSVCCompiler 这基本上是系统找不到它,我不知道我是否通过安装它使它变得更糟或什么,但是我无法继续 我不知道该怎么办,任何帮助都是最有用的

  C:\Users\micae\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    running bdist_wheel
    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.win-amd64-3.8
    creating build\src.win-amd64-3.8\numpy
    creating build\src.win-amd64-3.8\numpy\distutils
    building library "npymath" sources
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    error: Could not initialize compiler instance: do you have Visual Studio
    installed?  If you are trying to build with MinGW, please use "python setup.py
    build -c mingw32" instead.  If you have Visual Studio installed, check it is
    correctly installed, and the right version (VS 2008 for python 2.6, 2.7 and 3.2,
    VS 2010 for >= 3.3).

    Original exception was: [WinError 3] El sistema no puede encontrar la ruta especificada: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\PlatformSDK\\lib', and the Compiler class was MSVCCompiler
    ============================================================================
    ============================================================================
    ----------------------------------------
    ERROR: Failed building wheel for numpy
    Running setup.py clean for numpy
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\micae\AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\micae\\AppData\\Local\\Temp\\pip-install-ip0nzt0h\\numpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\micae\\AppData\\Local\\Temp\\pip-install-ip0nzt0h\\numpy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
         cwd: C:\Users\micae\AppData\Local\Temp\pip-install-ip0nzt0h\numpy
    Complete output (10 lines):
    Running from numpy source directory.

    `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).


      C:\Users\micae\AppData\Local\Programs\Python\Python38\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
      building library "npymath" sources
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      error: Could not initialize compiler instance: do you have Visual Studio
      installed?  If you are trying to build with MinGW, please use "python setup.py
      build -c mingw32" instead.  If you have Visual Studio installed, check it is
      correctly installed, and the right version (VS 2008 for python 2.6, 2.7 and 3.2,
      VS 2010 for >= 3.3).

      Original exception was: [WinError 3] El sistema no puede encontrar la ruta especificada: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\PlatformSDK\\lib', and the Compiler class was MSVCCompiler
      ============================================================================
      ============================================================================

  ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\micae\AppData\Local\Programs\Python\Python38\python.exe' 'C:\Users\micae\AppData\Local\Programs\Python\Python38\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\micae\AppData\Local\Temp\pip-build-env-9bvfhm_w\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- wheel setuptools 'Cython>=0.29.2' 'numpy==1.13.3; python_version=='"'"'3.5'"'"' and platform_system!='"'"'AIX'"'"'' '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.5'"'"' 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'"'"'' Check the logs for full command output. ``` 

1 个答案:

答案 0 :(得分:0)

我建议使用Python 3.7

Python 3.8仍然很新,因此您将编译自己的所有程序包,并且,正如您所发现的,这可能会涉及到一些问题。

有一个相关的numpy issue,因为您想要(一点点)更多信息。