Pylab:为什么脚本是从Canopy命令提示符运行的,而不是Window的Powershell?

2024-06-01 03:10:04 发布

您现在位置:Python中文网/ 问答频道 /正文

enter image description here

当我尝试在Canopy 64位命令提示符下运行下面的Python脚本时,它可以工作,但是当我在标准窗口的Powershell上尝试它时,它给了我一个ImportError(参见图片)。我用同样的方法来管理文件。我cd到正确的目录,然后键入python前一年在

我注意到其他scipy模块也会出现这种情况。在

from pylab import *

t = arange(0.0, 2.0, 0.01)
s = sin(2*pi*t)
plot(t, s)

xlabel('time (s)')

ylabel('voltage (mV)')

title('About as simple as it gets, folks')

grid(True)

savefig("test.png")

show()

Tags: 模块方法目录脚本标准键入ascd