我无法使用 pip 安装 streamlit

I can't install streamlit with pip

我是 运行 python 3.8.2 和 Windows 10 上的 pip 20.1.1。当我尝试使用 pip install streamlit 安装 streamlit 时,我得到了一个长长的列表出现在控制台中的错误。一些错误似乎表明它需要安装在 < 3.7 的 python 版本上,但是 streamlit 应该适用于 3.8.2。有谁知道为什么会这样?

我无法包含整个错误,因为它超出了最大字符数限制,但如果有人需要其余部分,我可以提供。这是我能容纳的尽可能多的错误:

  ERROR: Command errored out with exit status 1:
   command: 'c:\users\lori\appdata\local\programs\python\python38-32\python.exe' 'c:\users\lori\appdata\local\programs\python\python38-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\LORI\AppData\Local\Temp\pip-build-env-l8t3vf24\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'cython >= 0.29' 'numpy==1.14.5; python_version<'"'"'3.7'"'"'' 'numpy==1.16.0; python_version>='"'"'3.7'"'"'' setuptools setuptools_scm wheel
       cwd: None
  Complete output (579 lines):
  Ignoring numpy: markers 'python_version < "3.7"' don't match your environment
  Collecting cython>=0.29
    Using cached Cython-0.29.21-cp38-cp38-win32.whl (1.6 MB)
  Collecting numpy==1.16.0
    Using cached numpy-1.16.0.zip (5.1 MB)
  Collecting setuptools
    Using cached setuptools-49.2.0-py3-none-any.whl (789 kB)
  Collecting setuptools_scm
    Using cached setuptools_scm-4.1.2-py2.py3-none-any.whl (27 kB)
  Collecting wheel
    Using cached wheel-0.34.2-py2.py3-none-any.whl (26 kB)
  Building wheels for collected packages: numpy
    Building wheel for numpy (setup.py): started
    Building wheel for numpy (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\lori\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\LORI\AppData\Local\Temp\pip-install-a17oetog\numpy\setup.py'"'"'; __file__='"'"'C:\Users\LORI\AppData\Local\Temp\pip-install-a17oetog\numpy\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\LORI\AppData\Local\Temp\pip-wheel-ga8cnrkz'
         cwd: C:\Users\LORI\AppData\Local\Temp\pip-install-a17oetog\numpy\
    Complete output (264 lines):
    Running from numpy source directory.
    C:\Users\LORI\AppData\Local\Temp\pip-install-a17oetog\numpy\numpy\distutils\misc_util.py:476: 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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\libs']
      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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\libs']
      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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\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

    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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\libs']
      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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\libs']
      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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\libs']
      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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\libs']
      NOT AVAILABLE

    accelerate_info:
      NOT AVAILABLE

    C:\Users\LORI\AppData\Local\Temp\pip-install-a17oetog\numpy\numpy\distutils\system_info.py:625: 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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\libs']
      NOT AVAILABLE

    C:\Users\LORI\AppData\Local\Temp\pip-install-a17oetog\numpy\numpy\distutils\system_info.py:625: 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\LORI\AppData\Local\Temp\pip-install-a17oetog\numpy\numpy\distutils\system_info.py:625: 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.
    non-existing path in 'numpy\distutils': 'site.cfg'
    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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\libs']
      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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\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\lori\appdata\local\programs\python\python38-32\lib
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries tatlas,tatlas not found in c:\users\lori\appdata\local\programs\python\python38-32\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\lori\appdata\local\programs\python\python38-32\libs
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries tatlas,tatlas not found in c:\users\lori\appdata\local\programs\python\python38-32\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\lori\appdata\local\programs\python\python38-32\lib
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries satlas,satlas not found in c:\users\lori\appdata\local\programs\python\python38-32\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\lori\appdata\local\programs\python\python38-32\libs
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries satlas,satlas not found in c:\users\lori\appdata\local\programs\python\python38-32\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\lori\appdata\local\programs\python\python38-32\lib
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries ptf77blas,ptcblas,atlas not found in c:\users\lori\appdata\local\programs\python\python38-32\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\lori\appdata\local\programs\python\python38-32\libs
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries ptf77blas,ptcblas,atlas not found in c:\users\lori\appdata\local\programs\python\python38-32\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\lori\appdata\local\programs\python\python38-32\lib
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries f77blas,cblas,atlas not found in c:\users\lori\appdata\local\programs\python\python38-32\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\lori\appdata\local\programs\python\python38-32\libs
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries f77blas,cblas,atlas not found in c:\users\lori\appdata\local\programs\python\python38-32\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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\libs']
      NOT AVAILABLE

    C:\Users\LORI\AppData\Local\Temp\pip-install-a17oetog\numpy\numpy\distutils\system_info.py:625: 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\LORI\AppData\Local\Temp\pip-install-a17oetog\numpy\numpy\distutils\system_info.py:625: 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\lori\appdata\local\programs\python\python38-32\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.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/
    ----------------------------------------
    ERROR: Failed building wheel for numpy
    Running setup.py clean for numpy
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\lori\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\LORI\AppData\Local\Temp\pip-install-a17oetog\numpy\setup.py'"'"'; __file__='"'"'C:\Users\LORI\AppData\Local\Temp\pip-install-a17oetog\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\LORI\AppData\Local\Temp\pip-install-a17oetog\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).

    ----------------------------------------
    ERROR: Failed cleaning build dir for numpy
  Failed to build numpy
  ERROR: opencv-python 4.3.0.36 has requirement numpy>=1.17.3, but you'll have numpy 1.16.0 which is incompatible.
  Installing collected packages: cython, numpy, setuptools, setuptools-scm, wheel
      Running setup.py install for numpy: started
      Running setup.py install for numpy: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: 'c:\users\lori\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\LORI\AppData\Local\Temp\pip-install-a17oetog\numpy\setup.py'"'"'; __file__='"'"'C:\Users\LORI\AppData\Local\Temp\pip-install-a17oetog\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\LORI\AppData\Local\Temp\pip-record-8idiuyk5\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\LORI\AppData\Local\Temp\pip-build-env-l8t3vf24\overlay' --compile --install-headers 'C:\Users\LORI\AppData\Local\Temp\pip-build-env-l8t3vf24\overlay\Include\numpy'
           cwd: C:\Users\LORI\AppData\Local\Temp\pip-install-a17oetog\numpy\
      Complete output (267 lines):
      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)


      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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\libs']
        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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\libs']
        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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\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

      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\lori\appdata\local\programs\python\python38-32\lib', 'C:\', 'c:\users\lori\appdata\local\programs\python\python38-32\libs']
        NOT AVAILABLE

在阅读了与您类似的 issue 之后,他们推荐了 Python 3.7,因为它不是 对于 3.8 相当稳定。

用户提供的另一种解决方案:

I was able to fix it by installing two visual studio dist packages: Download Visual C++ Build Tools installer and install it from here: http://go.microsoft.com/fwlink/?LinkId=691126&fixForIE=.exe

Go to this link and download the setup and install Visual C++ Redistributable for Visual Studio 2015: https://www.microsoft.com/en-in/download/details.aspx?id=48145

我不应该认为这个答案是“正确的”答案,但是,如果它解决了您的错误,我会很高兴。

问题出在 python 版本上。Streamlit 仅支持 uptil python 3.7.9。 所以我建议卸载所有以前的版本并安装 python 3.7 并尝试 运行 命令: “pip 安装 streamlit” 要么 “pip install --upgrade streamlit”