You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

导入aplpy报错:无法从astropy.config.configuration导入update_default_config

解决APLpy导入时的ImportError问题

这个错误是因为APLpy版本与当前安装的Astropy版本不兼容——旧版APLpy依赖的update_default_config函数,在新版Astropy中已从astropy.config.configuration模块移除。

解决方法

方法1:降级Astropy到兼容版本

APLpy 2.x系列兼容Astropy 4.x版本,执行以下命令降级:

  • 使用pip:
pip install astropy==4.3.1
  • 使用conda:
conda install astropy=4.3.1

方法2:安装APLpy的最新开发版

官方稳定版的APLpy可能未适配新版Astropy,直接从GitHub安装开发版可解决兼容问题:

pip install git+https://github.com/aplpy/aplpy.git

方法3:使用conda-forge的APLpy包

conda-forge源的APLpy通常已更新适配新Astropy,执行:

conda install -c conda-forge aplpy

内容的提问来源于stack exchange,提问作者laklak

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.30 12:39:56