无法使用Conda运行Python脚本

时间:2015-03-08 01:47:42

标签: python anaconda conda menpo

我试图在this tutorial中安装menpo。之后我安装了menpofit,menpo3d和menpodetect:

  

conda install -c menpo menpofit

     

conda install -c menpo menpo3d

     

conda install -c menpo menpodetect

接下来我从CMD运行这个python脚本( python testPy.py ):

import menpo.io as mio
from menpo.visualize import visualize_images

images = list(mio.import_images('A:/img/*.png'))
visualize_images(images)

获得此输出: enter image description here 我做错了什么以及如何解决它?

1 个答案:

答案 0 :(得分:4)

visualize_images似乎意在使用ipython-notebook。以常规python脚本调用它似乎不是作者想要的。

另请参阅文档的Visualizing Objects部分中的示例:

%matplotlib inline
import menpo.io as mio
from menpo.visualize import visualize_images

# import_images is a generator, so we must exhaust the generator before
# we can visualize the list. This is because the widget allows you to
# jump arbitrarily around the list, which cannot be done with generators.
images = list(mio.import_images('./path/to/images/*.jpg'))
visualize_images(images)