2014-07-20 150 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