Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed
@skirpichev

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions