[MacPorts] #67684: py38-astropy at 5.3 fails to import
MacPorts
noreply at macports.org
Sat Jun 24 23:04:56 UTC 2023
#67684: py38-astropy at 5.3 fails to import
--------------------------+--------------------
Reporter: odysseus9672 | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Keywords: | Port:
--------------------------+--------------------
I have py38-astropy at 5.3 installed and when I try to import the cosmology
sub-package, it fails. Here's the code and output:
{{{
Seans-Work-Macbook-Pro:~ sean$ python3.8
Python 3.8.17 (default, Jun 10 2023, 11:16:23)
[Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import astropy.cosmology as cosm
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8
/site-packages/astropy/cosmology/__init__.py", line 11, in <module>
from . import core, flrw, funcs, parameter, units, utils
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8
/site-packages/astropy/cosmology/funcs/__init__.py", line 5, in <module>
from .comparison import cosmology_equal
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8
/site-packages/astropy/cosmology/funcs/comparison.py", line 29, in
<module>
_FormatsT = Union[_FormatType, tuple[_FormatType, ...]]
TypeError: 'type' object is not subscriptable
>>>
}}}
Judging by
[https://github.com/astropy/astropy/commit/a1bc8b3fa819703eb0a1a38a03df115b85271a69
this commit] to the affected file, astropy 5.3 drops support for python
3.8. Using pip to force install [https://pypi.org/project/astropy/5.2.2/
astropy version 5.2.2] in my user directory solves the problem. So
py38-astropy should probably be pinned to version 5.2.2, unless this is an
unintentional bug in astropy.
--
Ticket URL: <https://trac.macports.org/ticket/67684>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list