从metpy.plots导入时,cTables是否未定义? [英] cTables Undefined when importing from metpy.plots?
问题描述
长期的程序员,但对python和metpy还是陌生的.我正在尝试通过遵循unidata网站和youtube(周一是卑鄙的星期一)上的示例来学习
longtime programmer but new to python and metpy. I'm trying to learn by following the examples on the unidata site and youtube (metpy mondays)
我正在尝试构建一个简单的偏斜课程并遇到问题.当我尝试像这样使用导入时:
I'm trying to follow along with building a simple skew-t lesson and running into an issue. When I try to use imports like so:
from datetime import datetime
from siphon.simplewebservice.wyoming import WyomingUpperAir
from metpy.units import units
import matplotlib.pyplot as plt
import metpy.plots as plots
%matplotlib inline
我收到此错误:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-4-afb9be7497de> in <module>
3 from metpy.units import units
4 import matplotlib.pyplot as plt
----> 5 import metpy.plots as plots
6
7 get_ipython().run_line_magic('matplotlib', 'inline')
C:\Miniconda_Python\envs\unidata\lib\site-packages\metpy\plots\__init__.py in <module>
17 logger = logging.getLogger(__name__)
18
---> 19 __all__ = ctables.__all__[:] # pylint: disable=undefined-variable
20 __all__.extend(declarative.__all__) # pylint: disable=undefined-variable
21 __all__.extend(skewt.__all__) # pylint: disable=undefined-variable
NameError: name 'ctables' is not defined
在此导入之前,我没有任何问题,所以想知道这里发生了什么吗?我的环境中的软件包之间是否存在一些不一致之处,或者我缺少什么?我已尝试更新所有内容以确保不使用任何旧版本.
I haven't had any issue with this import before so wondering what is going on here? Is there some inconsistency between the packages in my environment, or is there something I'm missing? I have tried updating everything to make sure I'm not using anything old.
作为参考,我将conda版本4.8.3与python 3.7.7和metpy 0.12.1一起使用.让我知道是否需要提供其他可能有用的信息.
For reference I am using conda version 4.8.3 with python 3.7.7 and metpy 0.12.1. Let me know if I need to provide any other information that may be helpful.
在此先感谢您的帮助!
推荐答案
所以该问题是由CartoPy 0.18引起的.我们正在努力发布0.12.2版本的MetPy来解决此问题.目前,最好的解决方法是将CartoPy恢复到0.17.
So that problem is caused by CartoPy 0.18. We're working on releasing a 0.12.2 version of MetPy to fix this. For now the best work-around is to roll CartoPy back to 0.17.
这篇关于从metpy.plots导入时,cTables是否未定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!