Skip to content

BUG: astropy.units fails to import with numpy 1.23.0dev #12534

Closed

Description

@neutrinoceros

Description

There is an incompatibility in astropy.units + numpy 1.23 which I believe is trivial to fix

Expected behavior

Success

Actual behavior

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/robcleme/.pyenv/versions/amical_tmp/lib/python3.10/site-packages/astropy/units/__init__.py", line 17, in <module>
    from .quantity import *
  File "/Users/robcleme/.pyenv/versions/amical_tmp/lib/python3.10/site-packages/astropy/units/quantity.py", line 32, in <module>
    from .quantity_helper import (converters_and_unit, can_have_arbitrary_unit,
  File "/Users/robcleme/.pyenv/versions/amical_tmp/lib/python3.10/site-packages/astropy/units/quantity_helper/__init__.py", line 10, in <module>
    from . import helpers, function_helpers
  File "/Users/robcleme/.pyenv/versions/amical_tmp/lib/python3.10/site-packages/astropy/units/quantity_helper/function_helpers.py", line 126, in <module>
    np.asscalar, np.alen,
  File "/Users/robcleme/.pyenv/versions/amical_tmp/lib/python3.10/site-packages/numpy/__init__.py", line 315, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'asscalar'. Did you mean: 'isscalar'?

Steps to Reproduce

pip install git+https://github.com/numpy/numpy.git
pip install -U -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy
import astropy.units

System Details

No relevant

Activity

  1. github-actions commented on Nov 29, 2021

    @github-actions
    Contributor

    Welcome to Astropy 👋 and thank you for your first issue!

    A project member will respond to you as soon as possible; in the meantime, please double-check the guidelines for submitting issues and make sure you've provided the requested details.

    GitHub issues in the Astropy repository are used to track bug reports and feature requests; If your issue poses a question about how to use Astropy, please instead raise your question in the Astropy Discourse user forum and close this issue.

    If you feel that this issue has not been responded to in a timely manner, please leave a comment mentioning our software support engineer @embray, or send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail [email protected].

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions