Why I Cant install numpy

255 Views Asked by At

I always get this error, it seems to be related to python.h, could someone help me? I am using windows for my virtual environment in python im using python 3.10.6 **

C:\Users\Dsnie> pip install numpy
Collecting numpy
  Using cached numpy-1.26.0.tar.gz (15.6 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      + C:\msys64\mingw64\bin\python.exe C:\Users\Dsnie\AppData\Local\Temp\pip-install-rmir3q3w\numpy_c2d58ccd31904cc9a4edbc91bd1755a7\vendored-meson\meson\meson.py setup C:\Users\Dsnie\AppData\Local\Temp\pip-install-rmir3q3w\numpy_c2d58ccd31904cc9a4edbc91bd1755a7 C:\Users\Dsnie\AppData\Local\Temp\pip-install-rmir3q3w\numpy_c2d58ccd31904cc9a4edbc91bd1755a7\.mesonpy-llk80wd6\build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\Dsnie\AppData\Local\Temp\pip-install-rmir3q3w\numpy_c2d58ccd31904cc9a4edbc91bd1755a7\.mesonpy-llk80wd6\build\meson-python-native-file.ini
      The Meson build system
      Version: 1.2.99
      Source dir: C:\Users\Dsnie\AppData\Local\Temp\pip-install-rmir3q3w\numpy_c2d58ccd31904cc9a4edbc91bd1755a7
      Build dir: C:\Users\Dsnie\AppData\Local\Temp\pip-install-rmir3q3w\numpy_c2d58ccd31904cc9a4edbc91bd1755a7\.mesonpy-llk80wd6\build
      Build type: native build
      Project name: NumPy
      Project version: 1.26.0
      C compiler for the host machine: cc (gcc 12.2.0 "cc (Rev1, Built by MSYS2 project) 12.2.0")
      C linker for the host machine: cc ld.bfd 2.39
      C++ compiler for the host machine: c++ (gcc 12.2.0 "c++ (Rev1, Built by MSYS2 project) 12.2.0")
      C++ linker for the host machine: c++ ld.bfd 2.39
      Cython compiler for the host machine: cython (cython 3.0.3)
      Host machine cpu family: x86_64
      Host machine cpu: x86_64
      Program python found: YES (C:\msys64\mingw64\bin\python.exe)
      Found pkg-config: C:\msys64\mingw64\bin\pkg-config.EXE (1.8.0)
      Run-time dependency python found: YES 3.10
      Has header "Python.h" with dependency python-3.10: NO

      ..\..\meson.build:46:2: ERROR: Problem encountered: Cannot compile `Python.h`. Perhaps you need to install python-dev|python-devel

      A full log can be found at C:\Users\Dsnie\AppData\Local\Temp\pip-install-rmir3q3w\numpy_c2d58ccd31904cc9a4edbc91bd1755a7\.mesonpy-llk80wd6\build\meson-logs\meson-log.txt
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details

I've already tried it with commands like

sudo apt update
sudo apt install python3-dev
0

There are 0 best solutions below