binascii.Error: Invalid base64-encoded string: number of data characters
解决办法:
import base64
d = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAA". # 模拟数据
# dd = d.split(",")[1] # base64解成图片保存本地,需要吧data:base64协议给去掉 ret = base64.b64decode(d, altchars=None, validate=False) print(ret)