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

Skip to content

Avoid importing numpy.distutils #53

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

Closed
mroeschke opened this issue Aug 15, 2023 · 3 comments
Closed

Avoid importing numpy.distutils #53

mroeschke opened this issue Aug 15, 2023 · 3 comments

Comments

@mroeschke
Copy link

The follow import statement seems to by default import numpy.distutils which has been deprecated:

     import scipy._lib.array_api_compat.array_api_compat.numpy as array_api_compat_numpy
../../../micromamba/envs/test/lib/python3.11/site-packages/scipy/_lib/array_api_compat/array_api_compat/numpy/__init__.py:1: in <module>
    from numpy import *
../../../micromamba/envs/test/lib/python3.11/site-packages/numpy/__init__.py:331: in __getattr__
    import numpy.distutils as distutils
../../../micromamba/envs/test/lib/python3.11/site-packages/numpy/distutils/__init__.py:31: in <module>
    warnings.warn("\n\n"
E   DeprecationWarning:
E
E     `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
E     of the deprecation of `distutils` itself. It will be removed for
E     Python >= 3.12. For older Python versions it will remain present.
E     It is recommended to use `setuptools < 60.0` for those Python versions.
E     For more details, see:
E       https://numpy.org/devdocs/reference/distutils_status_migration.html

I am guessing it is not needed for array-api-compat and would be great to avoid

@rgommers
Copy link
Member

This is a numpy issue rather than an array-api-compat one (and it's hard to avoid from numpy import * in this package). I see that it's too annoying - I'll go fix it in numpy.

@rgommers
Copy link
Member

Should be fixed by numpy/numpy#24427, closing this issue.

@mroeschke
Copy link
Author

Thanks for the quick fix!

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

2 participants