Skip to content

Problem with importing erfa and astropy or photutils in iPython/Spyder #92

@kbagnall-quera

Description

@kbagnall-quera

Hi,
I'm a newbie - sorry for my inexperience. I'm running iPython inside Spyder and trying to use astropy and photutils. I installed pyerfa, astropy, and photutils inside iPython using '!pip install pyerfa' but I get the following error when I try to import erfa.

import erfa
[autoreload of erfa.version failed: Traceback (most recent call last):
File "C:\Users\kbagnall\AppData\Local\Programs\Spyder\pkgs\IPython\extensions\autoreload.py", line 245, in check
superreload(m, reload, self.old_objects)
File "C:\Users\kbagnall\AppData\Local\Programs\Spyder\pkgs\IPython\extensions\autoreload.py", line 394, in superreload
module = reload(module)
File "imp.py", line 314, in reload
File "importlib_init
.py", line 159, in reload
ImportError: parent 'erfa' not in sys.modules
]
Traceback (most recent call last):

File "C:\Users\kbagnall\AppData\Local\Temp\ipykernel_14788\3657507462.py", line 1, in <cell line: 1>
import erfa

File "C:\Users\kbagnall\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\erfa_init_.py", line 5, in
from .version import version as version # noqa

File "C:\Users\kbagnall\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\erfa\version.py", line 25, in
from . import ufunc

ImportError: cannot import name 'ufunc' from partially initialized module 'erfa' (most likely due to a circular import) (C:\Users\kbagnall\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\erfa_init_.py)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions