Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numpy.distutils deprecated for Python >= 3.12 #35

Open
vstevano opened this issue Nov 22, 2024 · 2 comments
Open

numpy.distutils deprecated for Python >= 3.12 #35

vstevano opened this issue Nov 22, 2024 · 2 comments

Comments

@vstevano
Copy link

The setup.py file uses numpy.distutils that is depreciated in newer versions of Python and numpy. The easy fix to replace:

from numpy.distutils.core import setup, Extension

with:

from setuptools import Extension, setup

returns the following error:

python setup.py build
/Users/vstevano/software/pylada/lib/python3.12/site-packages/setuptools/_distutils/extension.py:139: UserWarning: Unknown Extension options: 'extra_f90_compile_args', 'f2py_options'
warnings.warn(msg)
running build
running build_py
copying p2ptrans/interfaces.py -> build/lib.macosx-14.0-x86_64-cpython-312/p2ptrans
copying p2ptrans/config.py -> build/lib.macosx-14.0-x86_64-cpython-312/p2ptrans
copying p2ptrans/analysis.py -> build/lib.macosx-14.0-x86_64-cpython-312/p2ptrans
copying p2ptrans/format_spglib.py -> build/lib.macosx-14.0-x86_64-cpython-312/p2ptrans
copying p2ptrans/init.py -> build/lib.macosx-14.0-x86_64-cpython-312/p2ptrans
copying p2ptrans/core.py -> build/lib.macosx-14.0-x86_64-cpython-312/p2ptrans
copying p2ptrans/display.py -> build/lib.macosx-14.0-x86_64-cpython-312/p2ptrans
copying p2ptrans/utils.py -> build/lib.macosx-14.0-x86_64-cpython-312/p2ptrans
running build_ext
building 'p2ptrans.fmodules' extension
error: unknown file type '.f90' (from 'source/lap.f90')

@lekah
Copy link

lekah commented Dec 11, 2024

FYI, this worked for transitioning my code: https://github.com/lekah/samos/blob/master/setup.py

@ftherrien
Copy link
Owner

Thanks @lekah, I will take a look soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants