【问题标题】:Unable to download streamlit using pip in command prompt无法在命令提示符下使用 pip 下载 streamlit
【发布时间】:2020-11-22 19:08:02
【问题描述】:

我正在尝试使用 pip 在 window10 中安装 streamlit,但在安装构建依赖项后出现以下错误:

C:\Users\Admin\AppData\Local\Temp\pip-install-c7t4bt44\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\Admin\AppData\Local\Temp\pip-install-c7t4bt44\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\admin\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 "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
  ERROR: Command errored out with exit status 1: 'c:\users\admin\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-c7t4bt44\\numpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-c7t4bt44\\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\Admin\AppData\Local\Temp\pip-record-grjth94n\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\Admin\AppData\Local\Temp\pip-build-env-3avyqeva\overlay' --compile --install-headers 'C:\Users\Admin\AppData\Local\Temp\pip-build-env-3avyqeva\overlay\Include\numpy' Check the logs for full command output.
 ERROR: Command errored out with exit status 1: 'c:\users\admin\appdata\local\programs\python\python38-32\python.exe' 'c:\users\admin\appdata\local\programs\python\python38-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Admin\AppData\Local\Temp\pip-build-env-3avyqeva\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 Check the logs for full command output.

这只是错误的一小部分,非常冗长。我应该怎么做才能解决这个问题?

【问题讨论】:

  • 你用的是哪个版本的python?
  • 我用的是3.8版
  • 我在使用 python 3.8 时也遇到了这个问题,我的解决方法是改用 python 3.7。尝试使用 python 3.7 创建一个 virtualenv,然后重试。或者降级 numpy 也对我有用

标签: python windows pip command-prompt streamlit


【解决方案1】:

由于你使用的是windows,请尝试安装或检查是否安装了这两个visual studio dist包:

再次尝试安装所需的python包。

作为提示,请尝试创建一个虚拟环境并在那里继续安装。另外我可能会检查python版本。我在尝试使用 python3.8 时遇到了这个问题,所以如果你现在使用 python3.8,也许你可以使用 3.7。 ;)

【讨论】:

    【解决方案2】:

    我认为这个问题出在你的 NumPy 库上。

    你的 numpy 是如何安装的?如果您还没有,我建议您使用 conda。 Numpy 有时会在 Windows 上构建问题。

    我会给你一个 conda 安装的链接,如果这样的话你可以试试。 https://docs.conda.io/projects/conda/en/latest/user-guide/install/windows.html

    【讨论】:

    • 我绝对不会尝试使用 conda!你为什么这么说?你能解释一下吗
    猜你喜欢
    • 2021-02-16
    • 1970-01-01
    • 2019-06-28
    • 1970-01-01
    • 2014-07-11
    • 1970-01-01
    • 2020-10-17
    • 2021-08-17
    • 2019-10-20
    相关资源
    最近更新 更多