1
我正在嘗試在Eclipse中使用PIL。我已成功地安裝以下軟件包使這一代碼運行而不會出現錯誤:在Eclipse中使用Python Imaging Library(PIL)
from PIL import Image
import os
from pylab import *
from scipy.misc import *
im = array(Image.open('empire.jpg').convert('L'))
但是,下面的:
imshow(im)
產生錯誤:
raise RuntimeError('Could not execute image viewer.')
RuntimeError: Could not execute image viewer.
我試圖安裝Eclipse Marketplace中的基本圖像查看器。它不能解決問題。
有誰知道如何讓Eclipse顯示圖像?
在此先感謝。
跑了我OK(Windows中,python2.6的)。我評論了未使用的scipy導入,並在末尾添加了'show()' – Roberto
謝謝!這也適用於我。只是刪除未使用的scipy.misc導入刪除了問題。也許與圖像查看器存在衝突... – dave
我添加了一個具有相同信息的回覆。既然這有幫助,也許你可以把它標記爲已接受? – Roberto