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

Incompatibility between astropy 5.0.1 and agnpy 0.1.8 ? #116

Open
garciagenrique opened this issue Mar 4, 2022 · 1 comment
Open

Incompatibility between astropy 5.0.1 and agnpy 0.1.8 ? #116

garciagenrique opened this issue Mar 4, 2022 · 1 comment

Comments

@garciagenrique
Copy link

Hi,
I found and error when installing agnpy from pip, that brings the latests version of astropy (v0.5.1).

When importing agnpy it raises the following error (see below). I downgrade astropy to 4.2 and agnpy can be imported correctly.

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/opt/conda/lib/python3.8/site-packages/astropy/units/_typing.py in <module>
      8 try:  # py 3.9+
----> 9     from typing import Annotated
     10 except (ImportError, ModuleNotFoundError):  # optional dependency

ImportError: cannot import name 'Annotated' from 'typing' (/opt/conda/lib/python3.8/typing.py)

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
<ipython-input-1-4024036b86cf> in <module>
----> 1 import agnpy

/opt/conda/lib/python3.8/site-packages/agnpy/__init__.py in <module>
----> 1 from .spectra import *
      2 from .emission_regions import *
      3 from .targets import *
      4 from .synchrotron import *
      5 from .compton import *

/opt/conda/lib/python3.8/site-packages/agnpy/spectra/__init__.py in <module>
----> 1 from .spectra import *

/opt/conda/lib/python3.8/site-packages/agnpy/spectra/spectra.py in <module>
      1 # module containing the electron spectra
      2 import numpy as np
----> 3 import astropy.units as u
      4 from ..utils.math import trapz_loglog
      5 from ..utils.conversion import mec2

/opt/conda/lib/python3.8/site-packages/astropy/units/__init__.py in <module>
     38 
     39 from .structured import *
---> 40 from .decorators import *
     41 
     42 del bases

/opt/conda/lib/python3.8/site-packages/astropy/units/decorators.py in <module>
     11 import numpy as np
     12 
---> 13 from . import _typing as T
     14 from .core import (Unit, UnitBase, UnitsError,
     15                    add_enabled_equivalencies, dimensionless_unscaled)

/opt/conda/lib/python3.8/site-packages/astropy/units/_typing.py in <module>
     16 
     17     else:
---> 18         from typing_extensions import *  # override typing
     19 
     20 HAS_ANNOTATED = Annotated is not NotImplemented

AttributeError: module 'typing_extensions' has no attribute 'OrderedDictTypedDict'
@cosimoNigro
Copy link
Owner

Thanks @garciagenrique, I will look into it.

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