1
我通過Spyder(Python 2.7)運行一些代碼,它在我的同事的mac上運行得非常好,但在我的PC上,以下錯誤:Python 2.7錯誤:「AttributeError:'模塊'對象沒有屬性'單元'」
File "C:\Users\eawth\Miniconda2\lib\site-packages\iris\analysis\cartography.py", line 44, in <module>
DEFAULT_SPHERICAL_EARTH_RADIUS_UNIT = cf_units.Unit('m')
AttributeError: 'module' object has no attribute 'Unit'
當我點擊它帶我到一個文件中的錯誤,形成氣象局(cartography.py)和線路44寫着:
DEFAULT_SPHERICAL_EARTH_RADIUS_UNIT = cf_units.Unit('m')
我如何能解決任何想法這個??
謝謝!
Here is a print screen of the first part of the cartography.py file from the MET Office
Here is a print screen of my file which then draws on cartography.py
你能從cartography.py發佈更多代碼嗎? –
您嘗試運行的文件是否恰好被稱爲'cartography.py'?如果是這樣,請改變它。 – DeepSpace
嗨@AnthonyRossi我添加了錯誤文件的屏幕截圖。 – ErikaAWT