[Python] How can I change the version of Python Windows will use for my code and install numpy?

Discussão em 'Python' iniciado por Stack, Fevereiro 4, 2025.

  1. Stack

    Stack Membro Participativo

    When I try pip install numpy, it outputs an error:

    Build type: native build
    Project name: NumPy
    Project version: 2.2.2
    C compiler for the host machine: cc (gcc 13.2.0 "cc (Rev3, Built by MSYS2 project) 13.2.0")
    C linker for the host machine: cc ld.bfd 2.41
    C++ compiler for the host machine: c++ (gcc 13.2.0 "c++ (Rev3, Built by MSYS2 project) 13.2.0")
    C++ linker for the host machine: c++ ld.bfd 2.41
    Cython compiler for the host machine: cython (cython 3.0.11)
    Host machine cpu family: x86_64
    Host machine cpu: x86_64
    Program python found: YES (C:\msys64\ucrt64\bin\python.exe)
    Found pkg-config: YES (C:\msys64\ucrt64\bin\pkg-config.EXE) 2.1.0
    Run-time dependency python found: YES 3.11
    Has header "Python.h" with dependency python-3.11: NO


    The last two lines are what grabbed my attention. I want to use Python 3.13, because I think it will come with this header (Python.h) and solve the issue.

    I tried installing Python 3.13 from official website, from Microsoft Store and adding the files to PATH at the top, but it didn't work. When I type python --version in cmd, it outputs 3.11.7. Same for python3 --version. I am sure I added the files to the Path correctly. How can I fix this?

    Continue reading...

Compartilhe esta Página