首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >错误:退出状态1错误的命令:“在pip安装-r requirements.txt期间

错误:退出状态1错误的命令:“在pip安装-r requirements.txt期间
EN

Stack Overflow用户
提问于 2022-01-10 16:21:33
回答 2查看 2.4K关注 0票数 -2

得到一些奇怪的错误,上面写着" error :命令错误了,退出状态为1:“我所做的就是pip -r requirements.txt。我试过单独下载和安装所有依赖项,并已成功安装,但这里显示了错误。

代码语言:javascript
运行
复制
tensorflow>=1.15.2
keras==2.3.1
imutils==0.5.3
numpy==1.18.2
opencv-python==4.2.0.*
matplotlib==3.2.1
scipy==1.4.1

上面是我的requirements.txt文件。错误输出如下所示。

代码语言:javascript
运行
复制
Collecting tensorflow>=1.15.2
  Using cached tensorflow-2.7.0-cp39-cp39-win_amd64.whl (430.8 MB)
Collecting keras==2.3.1
  Using cached Keras-2.3.1-py2.py3-none-any.whl (377 kB)
Collecting imutils==0.5.3
  Using cached imutils-0.5.3.tar.gz (17 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting numpy==1.18.2
  Using cached numpy-1.18.2.zip (5.4 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'error'

  ERROR: Command errored out with exit status 1:
   command: 'D:\Projects\Python\Face-Mask-Detection\venv\Scripts\python.exe' 'D:\Projects\Python\Face-Mask-Detection\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\grvra\AppData\Local\Temp\tmpblo49wyv'
       cwd: C:\Users\grvra\AppData\Local\Temp\pip-install-mm4x42y9\numpy_0939fd38ac9946b9b25c934585e198b7
  Complete output (72 lines):
  Running from numpy source directory.
  setup.py:461: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
    run_build = parse_setuppy_commands()
  Cythonizing sources
  Processing numpy/random\_bounded_integers.pxd.in
  Processing numpy/random\mtrand.pyx
  C:\Users\grvra\AppData\Local\Temp\pip-install-mm4x42y9\numpy_0939fd38ac9946b9b25c934585e198b7\tools\cythonize.py:75: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    required_version = LooseVersion('0.29.14')
  C:\Users\grvra\AppData\Local\Temp\pip-install-mm4x42y9\numpy_0939fd38ac9946b9b25c934585e198b7\tools\cythonize.py:77: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if LooseVersion(cython_version) < required_version:
  Processing numpy/random\_bit_generator.pyx
  Processing numpy/random\_bounded_integers.pyx.in
  Processing numpy/random\_common.pyx
  Processing numpy/random\_generator.pyx
  Processing numpy/random\_mt19937.pyx
  Processing numpy/random\_pcg64.pyx
  Processing numpy/random\_philox.pyx
  Processing numpy/random\_sfc64.pyx
  Could not locate executable g77
  Could not locate executable f77
  Could not locate executable ifort
  Could not locate executable ifl
  Could not locate executable f90
  Could not locate executable DF
  Could not locate executable efl
  Could not locate executable gfortran
  Could not locate executable f95
  Could not locate executable g95
  Could not locate executable efort
  Could not locate executable efc
  Could not locate executable flang
  don't know how to compile Fortran code on platform 'nt'
  C:\Users\grvra\AppData\Local\Temp\pip-install-mm4x42y9\numpy_0939fd38ac9946b9b25c934585e198b7\numpy\distutils\system_info.py:1896: UserWarning:
      Optimized (vendor) Blas libraries are not found.
      Falls back to netlib Blas library which has worse performance.
      A better performance should be easily gained by switching
      Blas library.
    if self._calc_info(blas):
  C:\Users\grvra\AppData\Local\Temp\pip-install-mm4x42y9\numpy_0939fd38ac9946b9b25c934585e198b7\numpy\distutils\system_info.py:1896: 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.
    if self._calc_info(blas):
  C:\Users\grvra\AppData\Local\Temp\pip-install-mm4x42y9\numpy_0939fd38ac9946b9b25c934585e198b7\numpy\distutils\system_info.py:1896: 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.
    if self._calc_info(blas):
  C:\Users\grvra\AppData\Local\Temp\pip-install-mm4x42y9\numpy_0939fd38ac9946b9b25c934585e198b7\numpy\distutils\system_info.py:1730: 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.
    return getattr(self, '_calc_info_{}'.format(name))()
  C:\Users\grvra\AppData\Local\Temp\pip-install-mm4x42y9\numpy_0939fd38ac9946b9b25c934585e198b7\numpy\distutils\system_info.py:1730: 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.
    return getattr(self, '_calc_info_{}'.format(name))()
  C:\Users\grvra\AppData\Local\Temp\pip-build-env-lk0zd224\overlay\Lib\site-packages\setuptools\_distutils\dist.py:275: UserWarning: Unknown distribution option: 'define_macros'
    warnings.warn(msg)
  non-existing path in 'numpy\\distutils': 'site.cfg'
  running dist_info
  running build_src
  creating build
  creating build\src.win-amd64-3.9
  creating build\src.win-amd64-3.9\numpy
  creating build\src.win-amd64-3.9\numpy\distutils
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/84/1e/ff467ac56bfeaea51d4a2e72d315c1fe440b20192fea7e460f0f248acac8/numpy-1.18.2.zip#sha256=e7894793e6e8540dbeac77c87b489e331947813511108ae097f1715c018b8f3d (from https://pypi.org/simple/numpy/) (requires-python:>=3.5). Command errored out with exit status 1: 'D:\Projects\Python\Face-Mask-Detection\venv\Scripts\python.exe' 'D:\Projects\Python\Face-Mask-Detection\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\grvra\AppData\Local\Temp\tmpblo49wyv' Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement numpy==1.18.2 (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.13.0rc1, 1.13.0rc2, 1.13.0, 1.13.1, 1.13.3, 1.14.0rc1, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0rc1, 1.15.0rc2, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0rc1, 1.16.0rc2, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0rc1, 1.17.0rc2, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0rc1, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0rc1, 1.19.0rc2, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5, 1.20.0rc1, 1.20.0rc2, 1.20.0, 1.20.1, 1.20.2, 1.20.3, 1.21.0rc1, 1.21.0rc2, 1.21.0, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.22.0rc1, 1.22.0rc2, 1.22.0rc3, 1.22.0)
ERROR: No matching distribution found for numpy==1.18.2
EN

回答 2

Stack Overflow用户

发布于 2022-01-10 16:24:21

您强制pip安装(numpy==1.18.2)的numpy版本出现了问题,请删除该版本(只需放置numpy),然后重试pip install -r requirements.txt

票数 1
EN

Stack Overflow用户

发布于 2022-01-10 16:27:45

键在输出的末尾找到。

代码语言:javascript
运行
复制
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/84/1e/ff467ac56bfeaea51d4a2e72d315c1fe440b20192fea7e460f0f248acac8/numpy-1.18.2.zip#sha256=e7894793e6e8540dbeac77c87b489e331947813511108ae097f1715c018b8f3d (from https://pypi.org/simple/numpy/) (requires-python:>=3.5). Command errored out with exit status 1: 'D:\Projects\Python\Face-Mask-Detection\venv\Scripts\python.exe' 'D:\Projects\Python\Face-Mask-Detection\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\grvra\AppData\Local\Temp\tmpblo49wyv' Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement numpy==1.18.2 (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.13.0rc1, 1.13.0rc2, 1.13.0, 1.13.1, 1.13.3, 1.14.0rc1, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0rc1, 1.15.0rc2, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0rc1, 1.16.0rc2, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0rc1, 1.17.0rc2, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0rc1, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0rc1, 1.19.0rc2, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5, 1.20.0rc1, 1.20.0rc2, 1.20.0, 1.20.1, 1.20.2, 1.20.3, 1.21.0rc1, 1.21.0rc2, 1.21.0, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.22.0rc1, 1.22.0rc2, 1.22.0rc3, 1.22.0)
ERROR: No matching distribution found for numpy==1.18.2

显然,您的MicrosoftVisualC++需要更新。如果没有理由使用特定的numpy版本,只需从需求文件中删除==1.18.2即可。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70655636

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档