无法安装numpy

az31mfrm  于 12个月前  发布在  其他
关注(0)|答案(2)|浏览(181)

我是Python新手。我试图安装numpy,但我得到了这个错误。收集ninja>=1.8.2使用缓存ninja-1.11.1.tar.gz(27 kB)安装构建依赖:已开始安装构建依赖项:已完成状态'done'获取构建轮子的需求:开始获取构建轮子的要求:已完成,状态为'done'正在准备元数据(pyproject.toml):已开始准备元数据(pyproject.toml):完成状态为'done'为收集的包构建轮子:ninja用于ninja的Building wheel(pyproject.toml):开始为ninja构建轮子(pyproject.toml):已完成,状态为“error”错误:有错误退出子进程

Building wheel for ninja (pyproject.toml) did not run successfully.
    exit code: 1

    [9 lines of output]
    Traceback (most recent call last):
      File "C:\Users\Lenovo\AppData\Local\Temp\pip-build-env-9e2mdrtx\overlay\lib\python3.10\site-packages\skbuild\setuptools_wrap.py", line 645, in setup
        cmkr = cmaker.CMaker(cmake_executable)
      File "C:\Users\Lenovo\AppData\Local\Temp\pip-build-env-9e2mdrtx\overlay\lib\python3.10\site-packages\skbuild\cmaker.py", line 148, in __init__
        self.cmake_version = get_cmake_version(self.cmake_executable)
      File "C:\Users\Lenovo\AppData\Local\Temp\pip-build-env-9e2mdrtx\overlay\lib\python3.10\site-packages\skbuild\cmaker.py", line 105, in get_cmake_version
        raise SKBuildError(msg) from err

    Problem with the CMake installation, aborting build. CMake executable is cmake
    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for ninja
  Failed to build ninja
  ERROR: Could not build wheels for ninja, which is required to install pyproject.toml-based projects
  [end of output]

注意:此错误源自子进程,可能不是pip的问题。错误:subprocess-exit-with-error
×安装后端依赖项的pip子进程未成功运行。│退出代码:1 ─>输出见上。
注意:此错误源自子进程,可能不是pip的问题。
谁能告诉我出了什么问题?以及如何解决它

jdgnovmf

jdgnovmf1#

Pip无法安装ninja软件包,这是使用numpy所必需的。
以下是信息:Failed building wheel for ninja
它还说它失败是因为CMake的错误。
以下是信息:Problem with the CMake installation, aborting build.
要解决这个问题,请尝试使用以下行安装CMakeapt-get install cmake

ryoqjall

ryoqjall2#

以下是您可以尝试解决此问题的一些步骤:

1 -升级pip

pip install --upgrade pip

2-安装CMake

apt-get install cmake

3-升级Setuptools和Wheel

pip install --upgrade setuptools wheel

4-安装numpy:尝试再次安装numpy:

pip install numpy

相关问题