我想从ipython笔记本中读取存储在Google驱动器中的图像。我尝试使用Image和请求:
import requests
from ipywidgets import Image
img = Image(requests.get("https://drive.google.com /open?id=XXXX4"))
type(img)
img
但图像坏了。或者如果我明确使用url输入:
img = Image(url=https://drive.google.com /open?id=XXXX4")
type(img)
img
' .com = ....'被识别为图像的格式,所以我得到了:
ValueError: Cannot embed the '.com=...' image format
此外,我尝试使用请求库直接导入文件,但在这种情况下,返回的整个html不是我想要的...感谢任何想法。