2014-07-20 149 views
0

我装蟒蛇发行的Python 2.7(一切工作正常),然后我安装SunPy以下SunPy installAstropy弃用警告

要安装SunPy的额外的依赖关系运行:

conda update astropy 
pip install suds 

要安装运行:

pip install sunpy 

但是,我运行这样的事情:

from astropy.io import fits 
file = fits.open("file.fits") 
file = file[0].data 

我有这样的警告,没有安装SunPy和更新Astropy

警告显示:AstropyDeprecationWarning:在[io.fits]文件“C的部分配置参数 'enabled_record_valued_keyword_cards':\用户\ nandhos.astropy \ config \ astropy.cfg'已弃用。改用[fits]中的'enable_record_valued_keyword_cards'。 [astropy.config.configuration]

显然,一切正常,只是我想知道为什么会出现此消息。如何在适合intead其他配置的部分使用“enable_record_valued_keyword_cards”?

回答

2

摆脱警告最简单的方法是简单地删除~/.astropy/config/astropy.cfg文件,如果你以前没有编辑它。这应该在随后的版本中解决。

+0

这就是全部?我删除了文件astropy.cfg,并保留了astropy.0.4.cfg和astropy.log。我运行并警告消失,并再次出现文件astropy.cfg,但没有警告。感谢 – nandhos

+0

为了清楚起见,Astropy配置系统在v0.4中进行了全面检查,因此如果您有旧的配置文件,则可能会出现类似这样的消息。请参阅:http://docs.astropy.org/en/stable/config/config_0_4_transition.html#config-0-4-transition – Iguananaut

+0

与此同时,如果您没有*没有过时的astropy.cfg和你仍然看到这样的消息,这是因为可能发生的一个微妙的错误:https://github.com/astropy/astropy/issues/2772 – Iguananaut