GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — NumPy does not install on Python 3.12.0b1 · Issue #23808 · numpy/numpy

NumPy does not install on Python 3.12.0b1 #23808

New issue
Copy link
New issue
Copy link
Closed
Closed
NumPy does not install on Python 3.12.0b1#23808
Copy link
Labels
32 - InstallationProblems installing or compiling NumPycomponent: build

Description

@bersbersbers
bersbersbers
opened on May 25, 2023
Issue body actions

Describe the issue:

Related:
pypa/pip#11501 (comment)
pypa/setuptools#3935

https://github.com/numpy/numpy/blob/cc0abd768575d7f9e862de0b4912af27f6e9690d/pyproject.toml#LL7C6-L7C16

Reproduce the code example:

pip install numpy

Error message:

pip install numpy
Collecting numpy
  Using cached numpy-1.24.3.tar.gz (10.9 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [33 lines of output]
      Traceback (most recent call last):
        File "C:\Users\bers\.pyenv-win-venv\envs\project_3.12\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\bers\.pyenv-win-venv\envs\project_3.12\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\bers\.pyenv-win-venv\envs\project_3.12\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 112, in get_requires_for_build_wheel
          backend = _build_backend()
                    ^^^^^^^^^^^^^^^^
        File "C:\Users\bers\.pyenv-win-venv\envs\project_3.12\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 77, in _build_backend
          obj = import_module(mod_path)
                ^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\bers\.pyenv\pyenv-win\versions\3.12.0b1\Lib\importlib\__init__.py", line 90, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<frozen importlib._bootstrap>", line 1293, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1266, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1216, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 400, in _call_with_frames_removed
        File "<frozen importlib._bootstrap>", line 1293, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1266, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1237, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 841, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 994, in exec_module
        File "<frozen importlib._bootstrap>", line 400, in _call_with_frames_removed
        File "C:\Users\bers\AppData\Local\Temp\pip-build-env-8dt1uf4c\overlay\Lib\site-packages\setuptools\__init__.py", line 16, in <module>
          import setuptools.version
        File "C:\Users\bers\AppData\Local\Temp\pip-build-env-8dt1uf4c\overlay\Lib\site-packages\setuptools\version.py", line 1, in <module>
          import pkg_resources
        File "C:\Users\bers\AppData\Local\Temp\pip-build-env-8dt1uf4c\overlay\Lib\site-packages\pkg_resources\__init__.py", line 2172, in <module>
          register_finder(pkgutil.ImpImporter, find_on_path)
                          ^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
      [end of output]

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

× Getting requirements to build wheel 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.

Runtime information:

Cannot install numpy :)
Python 3.12.0b1 on Windows 10 21H2

Context for the issue:

No response

Reacted by Balint Pato, Nicko van Someren, Рамиль, Theo Paris, Vincent Law, Aryan Kumar, chemik-bit, Vladimir Chistov, David Oluwasegun Moses, zailai and 3 more

Activity

Next
  1. bersbersbers
    added
    00 - Bug
    on May 25, 2023
  2. cclauss
    added a commit that references this issue on May 28, 2023

    pyproject.toml: Upgrade setuptools for Python 3.12 beta 1

    d67fa0b
  3. mattip commented on May 28, 2023

    @mattip
    mattip
    on May 28, 2023
    Member
    More actions

    We deliberately pin setuptools to work around other problems with numpy.distutils. The plan for python 3.12 is to move to the meson build system, and to deprecate use of setuptools. You can try out the meson build using python3.12 -m pip install -r build_requirements.txt; python3.12 -m spin build.

    Reacted by Sergei Ivanov
  4. cclauss
    added a commit that references this issue on May 28, 2023

    pyproject.toml: Upgrade setuptools for Python 3.12 beta 1

    1ee3971
  5. bersbersbers commented on May 28, 2023

    @bersbersbers
    bersbersbers
    on May 28, 2023
    ContributorAuthor
    More actions

    Thanks, understood!

    I just came across https://numpy.org/devdocs/reference/distutils_status_migration.html, which reads

    It may be beneficial to wait with migrating until there are examples from other projects to follow

    I agree in principle, but I feel that this approach may deadlock if many other projects depend on numpy :) for example, matplotlib does not install on 3.12.0b1 because it depends on numpy at build time, and then that dependency is carried further to all projects depending on matplotlib.

  6. mattip commented on May 28, 2023

    @mattip
    mattip
    on May 28, 2023
    Member
    More actions

    That advice could use an update, especially before the 1.25 release freezes the documentation. SciPy has migrated to meson-python, and NumPy should migrate soon. Rather than trying to get setuptools to work with python3.12, we should start testing the CPython 3.12b1 with meson.

  7. charris commented on May 28, 2023

    @charris
    charris
    on May 28, 2023
    Member
    More actions

    That advice could use an update, especially before the 1.25 release freezes the documentation.

    Could you open an issue for that? I am going to release 1.25.0rc1 without it, but there will still be time before the final.

  8. mattip commented on May 28, 2023

    @mattip
    mattip
    on May 28, 2023
    Member
    More actions

    matplotlib does not install on 3.12.0b1 because it depends on numpy at build time,

    Maybe we should be uploading pre-release wheels to https://anaconda.org/scientific-python-nightly-wheels/numpy. It seems cibuildwheel has a option for this

  9. rgommers commented on May 29, 2023

    @rgommers
    rgommers
    on May 29, 2023
    Member
    More actions

    I think now that 1.25.x has branched, we can make the switch to Meson by default in main. That will make pip install . & co work with Python 3.12 beta's (module any crashes due to incompatibilities between CPython, NumPy and Cython of course - and we know we have one of those right now: gh-23766). WDYT?

    Re uploading a nightly: let's consider it once NumPy actually passes its test suite with a CPython beta? It seems too early now, we don't even run it in our own CI yet.

    Reacted by Lysandros Nikolaou
  10. mattip commented on May 29, 2023

    @mattip
    mattip
    on May 29, 2023
    Member
    More actions

    We need SIMD testing to work to make the transition.

  11. rgommers commented on May 29, 2023

    @rgommers
    rgommers
    on May 29, 2023
    Member
    More actions

    We need SIMD testing to work to make the transition.

    That can still be done with python setup.py install, as is already done in armv7_simd_test.

  12. rgommers commented on Jun 8, 2023

    @rgommers
    rgommers
    on Jun 8, 2023
    Member
    More actions

    I think now that 1.25.x has branched, we can make the switch to Meson by default in main. That will make pip install . & co work with Python 3.12 beta's (module any crashes due to incompatibilities between CPython, NumPy and Cython of course

    This is being done in gh-23838 - which is close, but needs working through some CI failures. Until it is merged, one can either use the branch from which I made that PR, or follow the instructions at https://github.com/numpy/numpy/blob/main/building_with_meson.md#pip-install.

    Questions about this continue to come in, so I'll pin this issue.

    Reacted by stonebig, Tran Viet Huy, Jason R. Coombs and Nancy
  13. rgommers
    pinned this issue on Jun 8, 2023
  14. rgommers
    added
    component: build
    32 - InstallationProblems installing or compiling NumPy
    on Jun 8, 2023
  15. 47 remaining items

  16. skirpichev commented on Sep 8, 2023

    @skirpichev
    skirpichev
    on Sep 8, 2023
    More actions

    The last needed feature (f2py -c support for Python 3.12) was just merged and backported to 1.26.x yesterday.

    Great. But the f2py doesn't work with the new default backend without additional requirements:

    'meson-python;python_version>="3.12"',
    'ninja;python_version>="3.12"'
    

    @rgommers, maybe it does make sense to add these packages to the list of dependencies? Or to the project.optional-dependencies section?

  17. rgommers commented on Sep 8, 2023

    @rgommers
    rgommers
    on Sep 8, 2023
    Member
    More actions

    maybe it does make sense to add these packages to the list of dependencies? Or to the project.optional-dependencies section?

    Good question @skirpichev. Definitely not a required dependency, but optional-dependencies may make sense. We don't list any of those right now - we also have functionality that depends on cffi for example. I'll open a separate issue for this now, to not mix it with the general Python 3.12 support one here.

  18. rgommers commented on Sep 17, 2023

    @rgommers
    rgommers
    on Sep 17, 2023
    Member
    More actions

    NumPy 1.26.0 is up on PyPI and conda-forge, so we should be all good here. Thanks all!

    Reacted by Marc Mueller, Hugo van Kemenade, Paul Leclercq, Alex Ball, James O'Claire, Sean, BLTHDJ and Guillaume
  19. rgommers
    closed this as completedon Sep 17, 2023
  20. truhanen
    added 2 commits that reference this issue on Oct 30, 2023

    FIX: Limit NumPy version [no ci]

    1b3b9e3

    CHORE: Run tests on Python 3.12

    561801b
  21. jaraco
    added 2 commits that reference this issue on Dec 16, 2023

    Revert "Disable tests on Windows due to numpy doesn't install. Ref nu…

    97b77ee

    Revert "Grab later build of numpy; workaround for numpy/numpy#23808."

    ce7c685
  22. ghislainv
    added a commit that references this issue on Dec 18, 2023

    Skip Python 3.12 for building wheels because of a problem with

    738931c
  23. amorenoz
    added a commit that references this issue on Jan 2, 2024

    requirements: Fix build on Python 3.12.

    db995cd
  24. richli
    added a commit that references this issue on Feb 21, 2024

    Update minimum numpy version for Python 3.12

    c640b72
  25. clrpackages
    added a commit that references this issue on Mar 19, 2024

    pypi-zipp: Autospec creation for update from version 3.17.0 to versio…

    d665b18
  26. rebkwok
    added a commit that references this issue on Jun 9, 2025

    Add upper boundary on python version for package

    4e06bee
  27. hadisfr
    added 2 commits that reference this issue on Oct 6, 2025

    increase numpy version to be compatible with Python 3.12

    b1d1533

    increase numpy version to be compatible with Python 3.12

    eed8319
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    32 - InstallationProblems installing or compiling NumPycomponent: build

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.