Opened 2 years ago

Closed 2 years ago

#64030 closed defect (fixed)

py38-astropy @5.0 fails import

Reported by: odysseus9672 (Sean Lake) Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: py-astropy

Description

This is very similar to ticket #64029, but the error text is different. The recent update to astropy 5.0 for py38-astropy doesn't work. It's missing a dependency, perhaps? When I try to use it I get an error.

This is on MacPorts 2.7.1 with XCode 11.5 on Mac OS X 10.15.7.

Here's the output:

Traceback (most recent call last):
  File "./Analysis_Pix_v7.py", line 96, in <module>
    import astropy.io.ascii as aptxt
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/astropy/__init__.py", line 42, in <module>
    from . import config as _config  # noqa: E402
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/astropy/config/__init__.py", line 10, in <module>
    from .configuration import *
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/astropy/config/configuration.py", line 24, in <module>
    from astropy.utils import find_current_module, silence
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/astropy/utils/__init__.py", line 17, in <module>
    from .codegen import *  # noqa
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/astropy/utils/codegen.py", line 13, in <module>
    from .introspection import find_current_module
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/astropy/utils/introspection.py", line 12, in <module>
    from packaging.version import Version
ModuleNotFoundError: No module named 'packaging'

Change History (5)

comment:1 Changed 2 years ago by odysseus9672 (Sean Lake)

Yep, missing dependency in this one. Installing py38-packaging fixes this specific error, but leads to the following error:

Traceback (most recent call last):
  File "./Analysis_Pix_v7.py", line 96, in <module>
    import astropy.io.ascii as aptxt
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/astropy/io/ascii/__init__.py", line 7, in <module>
    from .core import (InconsistentTableError,
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/astropy/io/ascii/core.py", line 31, in <module>
    from astropy.table import Table
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/astropy/table/__init__.py", line 68, in <module>
    import astropy.io.fits.connect
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/astropy/io/fits/connect.py", line 13, in <module>
    from astropy.table import Table, serialize, meta, Column, MaskedColumn
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/astropy/table/meta.py", line 7, in <module>
    import yaml
ModuleNotFoundError: No module named 'yaml'

comment:2 Changed 2 years ago by odysseus9672 (Sean Lake)

And installing py38-yaml fixed this new error, and it runs now.

comment:3 Changed 2 years ago by reneeotten (Renee Otten)

Owner: set to Schamschula
Port: py-astropy added
Status: newassigned

comment:4 Changed 2 years ago by ul5255

we experience the same with python39 and py39-astropy. Installing py39-yaml and p39-packaging solves it:

>>> from astropy.table import Table
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/astropy/table/__init__.py", line 67, in <module>
    import astropy.io.ascii.connect
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/astropy/io/ascii/__init__.py", line 34, in <module>
    from .ecsv import Ecsv
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/astropy/io/ascii/ecsv.py", line 15, in <module>
    from astropy.table import meta, serialize
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/astropy/table/meta.py", line 7, in <module>
    import yaml
ModuleNotFoundError: No module named 'yaml'

and

>>> from astropy.io import fits as pyfits
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/astropy/__init__.py", line 42, in <module>
    from . import config as _config  # noqa: E402
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/astropy/config/__init__.py", line 10, in <module>
    from .configuration import *
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/astropy/config/configuration.py", line 24, in <module>
    from astropy.utils import find_current_module, silence
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/astropy/utils/__init__.py", line 17, in <module>
    from .codegen import *  # noqa
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/astropy/utils/codegen.py", line 13, in <module>
    from .introspection import find_current_module
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/astropy/utils/introspection.py", line 12, in <module>
    from packaging.version import Version
ModuleNotFoundError: No module named 'packaging'

comment:5 Changed 2 years ago by Schamschula (Marius Schamschula)

Resolution: fixed
Status: assignedclosed

In 9e9ee48486e0a390b5aa6602031ac969d0503d87/macports-ports (master):

py-astropy : add missing dependencies

Closes: #64030

Note: See TracTickets for help on using tickets.