当我要将 NumPy 安装到我的 PyCharm IDE 时,就会出现此错误

问题描述 投票:0回答:2

我的 PyCharm 项目路径是 :- D:\PycharmProjects

您可以查看下面的错误。此错误不是点错误。我听不懂它说什么。我尝试了很多次,以至于我看到了有关此问题的视频,但是这个错误没有解决,它仅在我要在 PyCharm 终端中安装 NumPy 时出现,如果我从 cmd 安装它,它会成功安装。

错误是:

(venv) PS D:\\PycharmProjects\> pip install numpy
Collecting numpy
Downloading numpy-1.26.4.tar.gz (15.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 15.8/15.8 MB 5.5 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... error
error: subprocess-exited-with-error

× pip subprocess to install backend dependencies did not run successfully.
│ exit code: 1
╰─\> \[36 lines of output\]
Collecting ninja\>=1.8.2
Using cached ninja-1.11.1.1.tar.gz (132 kB)
Installing build dependenci`your text`es: 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 'done'
Building wheels for collected packages: ninja
Building wheel for ninja (pyproject.toml): started
Building wheel for ninja (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error

            Building wheel for ninja (pyproject.toml) did not run successfully.
            exit code: 1
    
            [13 lines of output]
            C:\Users\User\AppData\Local\Temp\pip-build-env-cay87x7e\overlay\lib\python3.10\site-     packages\setuptools_scm\git.py:308: UserWarning: git archive did not support describe output
          warnings.warn("git archive did not support describe output")
        C:\Users\User\AppData\Local\Temp\pip-build-env-cay87x7e\overlay\lib\python3.10\site-packages\setuptools_scm\git.py:327: UserWarning: unprocessed git archival found (no export subst applied)
          warnings.warn("unprocessed git archival found (no export subst applied)")
        Traceback (most recent call last):
          File "C:\Users\User\AppData\Local\Temp\pip-build-env-cay87x7e\overlay\lib\python3.10\site-packages\skbuild\setuptools_wrap.py", line 645, in setup
            cmkr = cmaker.CMaker(cmake_executable)
          File "C:\Users\User\AppData\Local\Temp\pip-build-env-cay87x7e\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\User\AppData\Local\Temp\pip-build-env-cay87x7e\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]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install backend dependencies did not run successfully.
│ exit code: 1
╰─\> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I tried from you tube videos and google it then i cannot solve it
python numpy installation pip pycharm
2个回答
0
投票

据我所知,你应该重新安装最新版本的python ide文件和pycharm。您还可以转向使用 Python 和此类语言的程序员中著名的 VS Code。发生这种情况是因为系统中缺少文件导致了问题。


0
投票

如错误日志所示,您的问题不是源自 pip,而是源自 CMake。您应该仔细检查您的 CMake 安装是否已安装。如果没有,您可以从这里下载最新版本:https://cmake.org/download/

© www.soinside.com 2019 - 2024. All rights reserved.