Skip to content

BUG: f2py doesn't work on CPython 3.12 #24444

Closed

Description

@skirpichev

Describe the issue:

I got ModuleNotFoundError: No module named 'numpy.distutils'.

Probably, this coming with #23981 (transition to Meson), but I don't think that issue tracks the problem. Sorry if this is still a duplicate:(

Reproduce the code example:

$ touch a.f
$ python -m numpy.f2py -c a.f -m a

Error message:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/sk/venv/dev3.12/lib/python3.12/site-packages/numpy/f2py/__main__.py", line 5, in <module>
    main()
  File "/home/sk/venv/dev3.12/lib/python3.12/site-packages/numpy/f2py/f2py2e.py", line 702, in main
    run_compile()
  File "/home/sk/venv/dev3.12/lib/python3.12/site-packages/numpy/f2py/f2py2e.py", line 630, in run_compile
    from numpy.distutils.system_info import get_info
ModuleNotFoundError: No module named 'numpy.distutils'

Runtime information:

1.26.0b1
3.12.0rc1+ (heads/3.12:931df0a47c, Aug 18 2023, 10:14:11) [GCC 10.2.1 20210110]
WARNING: threadpoolctl not found in system! Install it by pip install threadpoolctl. Once installed, try np.show_runtime again for more detailed build information
[{'numpy_version': '1.26.0b1',
'python': '3.12.0rc1+ (heads/3.12:931df0a47c, Aug 18 2023, 10:14:11) [GCC '
'10.2.1 20210110]',
'uname': uname_result(system='Linux', node='note', release='5.10.0-24-amd64', version='#1 SMP Debian 5.10.179-5 (2023-08-08)', machine='x86_64')},
{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['SSSE3', 'SSE41', 'POPCNT', 'SSE42'],
'not_found': ['AVX',
'F16C',
'FMA3',
'AVX2',
'AVX512F',
'AVX512CD',
'AVX512_KNL',
'AVX512_KNM',
'AVX512_SKX',
'AVX512_CLX',
'AVX512_CNL',
'AVX512_ICL']}}]
None

Context for the issue:

No response

Activity

  1. added this to the 1.26.0 release milestone on Aug 18, 2023
  2. rgommers commented on Aug 18, 2023

    @rgommers
    Member

    This is a problem indeed, thanks for the report @skirpichev.

    This was supposed to be fixed by gh-22225 I think, but that never got finished. This may be blocking for the 1.26.0 release, at a minimum at needs a decision. So I added that milestone. And will ping on the PR.

  3. self-assigned this
    on Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions