【发布时间】:2013-12-09 02:37:15
【问题描述】:
我正在使用 Enthought Canopy,最近将 Scipy 和 numpy 升级到以下版本: scipy:0.13 构建 2 numpy:1.8 构建 1
当我尝试时:
from scipy import stats
我收到以下错误:
NameError Traceback (most recent call last)
<ipython-input-123-9d55e67ee92d> in <module>()
----> 1 from scipy import stats
C:\Users\M\AppData\Local\Enthought\Canopy\User\lib\site- packages\scipy\__init__.py in <module>()
75 # Import numpy symbols to scipy name space
76 import numpy as _num
---> 77 from numpy import oldnumeric
78 from numpy import *
79 from numpy.random import rand, randn
C:\Users\M\AppData\Local\Enthought\Canopy\User\lib\site-packages\numpy\oldnumeric\__init__.py in <module>()
9
10 _msg = "The oldnumeric module will be dropped in Numpy 1.9"
---> 11 warnings.warn(_msg, ModuleDeprecationWarning)
12
13
NameError: name 'ModuleDeprecationWarning' is not defined
不确定模块中发生了什么变化,或者我是否需要以不同的方式导入。
【问题讨论】:
-
我相信我能够通过在 scipy 和 numpy 更新后重新启动树冠来解决这个问题。试图在不重新启动的情况下运行代码似乎是导致错误的原因。