AttributeError: module 'openpyxl.drawing' has no attribute 'Image'

1,688 views
Skip to first unread message

nem...@gmail.com

unread,
Dec 10, 2016, 2:45:51 AM12/10/16
to openpyxl-users
I tried to insert GIF image in excel cell but it error occurs:

AttributeError: module 'openpyxl.drawing' has no attribute 'Image'
I'm using the last version of OPENPYXL

code:

image = openpyxl.drawing.Image(image)
image.anchor(ws.cell('E'+str(i+1)))
ws.add_image(image)


Does anybody have the issue like this?

jason....@gmail.com

unread,
Jun 7, 2018, 1:36:54 PM6/7/18
to openpyxl-users

as of 2017 openpyxl.drawing.Image has moved to openpyxl.drawing.image.Image

So just repace your call below with image = openpyxl.drawing.image.Image(image)

- J

ratanshi...@gmail.com

unread,
Nov 7, 2019, 1:13:06 AM11/7/19
to openpyxl-users
add the cell number after image in 
ws.add_image(image,'A1')
Reply all
Reply to author
Forward
0 new messages