0
我已成功在我的盒式磁帶(Python 2.7)中安裝了PIL和reportlab,並通過控制檯中的ssh測試了它們。Openshift reportlab PIL問題
不知何故,reportlab不能使用PIL。
我也嘗試下載PIL並修復了64位問題,但我仍然得到錯誤。
這消息我得到:
unpack requires a string argument of length 1
Imaging Library not available, unable to import bitmaps only jpegs
fileName='/var/lib/openshift/52c1ab8de0b8cdb8a1000177/app-root/runtime/repo/wsgi/static/images/logo_colegio.png' identity=[[email protected] filename='/var/lib/openshift/52c1ab8de0b8cdb8a1000177/app-root/runtime/repo/wsgi/static/images/logo_colegio.png']
fileName='/var/lib/openshift/52c1ab8de0b8cdb8a1000177/app-root/runtime/repo/wsgi/static/images/logo_colegio.png' identity=[[email protected] filename='/var/lib/openshift/52c1ab8de0b8cdb8a1000177/app-root/runtime/repo/wsgi/static/images/logo_colegio.png']
我擡起頭的代碼,發現這是在異常應該拋出:
if haveImages:
#detect which library we are using and open the image
if not self._image:
self._image = self._read_image(self.fp)
if getattr(self._image,'format',None)=='JPEG':
self.jpeg_fh = self._jpeg_fh
else:
from reportlab.pdfbase.pdfutils import readJPEGInfo
try:
self._width,self._height,c=readJPEGInfo(self.fp)
except:
annotateException('\nImaging Library not available, unable to import
bitmaps only jpegs\nfileName=%r identity=%s'%(fileName, self.identity()))
它應該只提高,如果「haveImages」是假。奇怪的是,我用控制檯打印reportlab.util.haveImage並得到「真」
我用盡想法...有沒有人遇到過這樣的情況? 任何想法將不勝感激!
PD:發生這種情況時,我嘗試將圖像添加到幀,使用addFromList()((鴨嘴獸))