我打开Python3解释器并键入:
import scipy.misc
scipy.misc.imsave
结果是
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'imsave'
名称改变了吗?在Python2中它运行良好,但我不想倒退迁移。
我在Lubuntu 13.04上安装了Python 3.3.1,并从默认存储库下载了所有模块。Scipy已安装,print(scipy.misc.__doc__)
显示应该有imsave
。
编辑:
scipy.__version__
显示0.11.0
from scipy.misc import imsave
会给出:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name imsave
scipy.__version__
是什么?from scipy.misc import imsave
是做什么的?如果你将scipt.misc.imsave
改为scipy.misc.imsave
会发生什么? - askewchanscipy.misc.imsave
来自于pilutils
,它依赖于PIL
。您是否已经安装了PIL
?如果是的话,升级scipy
可能是值得的,因为现在已经更新到了0.13.0
版本。即使升级不是必须的,重新安装也许是有必要的。 - askewchan