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

Error: module 'numpy' has no attribute 'asscalar' #63

Open
shelkmike opened this issue May 1, 2023 · 2 comments
Open

Error: module 'numpy' has no attribute 'asscalar' #63

shelkmike opened this issue May 1, 2023 · 2 comments

Comments

@shelkmike
Copy link

shelkmike commented May 1, 2023

qc3C exits with the error Error: module 'numpy' has no attribute 'asscalar'.
The reason is that numpy.asscalar() is absent in NumPy 1.23 and newer.

Fixed this by running conda install -n qc3c numpy=1.22

@AlcaArctica
Copy link

Thanks. I had the same problem. This fixed it!

@Rohit-Satyam
Copy link

Hi

The above trick didn't help. I still get the error:
I tried with both 1.21 and 1.22 version

Traceback (most recent call last):
  File "/home/subudhak/miniconda3/envs/qc3c/bin/qc3C", line 7, in <module>
    from qc3C.command_line import main
  File "/home/subudhak/miniconda3/envs/qc3c/lib/python3.8/site-packages/qc3C/command_line.py", line 4, in <module>
    import qc3C.bam_based as bam
  File "/home/subudhak/miniconda3/envs/qc3c/lib/python3.8/site-packages/qc3C/bam_based.py", line 11, in <module>
    from astropy.stats import sigma_clipped_stats
  File "/home/subudhak/miniconda3/envs/qc3c/lib/python3.8/site-packages/astropy/stats/__init__.py", line 22, in <module>
    from . import circstats
  File "/home/subudhak/miniconda3/envs/qc3c/lib/python3.8/site-packages/astropy/stats/circstats.py", line 14, in <module>
    from astropy.units import Quantity
  File "/home/subudhak/miniconda3/envs/qc3c/lib/python3.8/site-packages/astropy/units/__init__.py", line 17, in <module>
    from .quantity import *
  File "/home/subudhak/miniconda3/envs/qc3c/lib/python3.8/site-packages/astropy/units/quantity.py", line 29, in <module>
    from .quantity_helper import (converters_and_unit, can_have_arbitrary_unit,
  File "/home/subudhak/miniconda3/envs/qc3c/lib/python3.8/site-packages/astropy/units/quantity_helper/__init__.py", line 10, in <module>
    from . import helpers, function_helpers
  File "/home/subudhak/miniconda3/envs/qc3c/lib/python3.8/site-packages/astropy/units/quantity_helper/function_helpers.py", line 127, in <module>
    np.asscalar,
  File "/home/subudhak/.local/lib/python3.8/site-packages/numpy/__init__.py", line 320, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'asscalar'

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