Photutils错误:无法导入名称“ NUMPY_LT_1_14_1”

时间:2018-10-09 01:09:00

标签: python astropy photutils

我是第一次使用python进行测光,所以我正在研究有关背景提取,Aperture测光等的Photutils教程,我正在Python 3中使用笔记本,并使用anaconda下载了最新的Photutils软件包。当我尝试执行此操作时:

from photutils import CircularAperture
positions = [(30., 30.), (40., 40.)]
apertures = CircularAperture(positions, r=3.)
from astropy import units as u
from astropy.coordinates import SkyCoord
from photutils import SkyCircularAperture
positions = SkyCoord(l=[1.2, 2.3] * u.deg, b=[0.1, 0.2] * u.deg,
                     frame='galactic')
apertures = SkyCircularAperture(positions, r=4. * u.arcsec)

我收到错误,无法导入名称“ NUMPY_LT_1_14_1”

从photutils导入Background2D,MedianBackground和导入make_source_mask

有什么想法吗?

谢谢! 海伦

1 个答案:

答案 0 :(得分:1)

您拥有什么版本的Astropy和photutils?

您可以使用

进行查找
import astropy
print(astropy.__version__)
import photutils
print(photutils.__version__)

请注意,最新版本是photutils 0.5(请参阅https://pypi.org/project/photutils/#history),并使用Gi​​thub搜索NUMPY_LT_1_14_1,我发现https://github.com/astropy/photutils/commit/36b1f6a6a9802d0d49d34837434630b9136cf0b2对此进行了更改,应包含在photutils 0.5中。

如果您使用的是较旧的photutils,解决方案将是进行更新。如果您的最新版本为0.5,可以在https://github.com/astropy/photutils/issues/new处打开一个问题,并在问题报告中同时发布触发错误和导致回溯的代码以及photutils和Astropy版本号吗?