我正在尝试执行一个需要img2pdf模块的python脚本。注意,我已经为python-img2pdf安装了Ubuntu包:/usr/bin/img2pdfimport img2pdfModuleNotFoundError: No module named 'img2pdf'
我之前只安装了python3.6版本,现在我已经安装了python3.9.1,在那之后,我开始收到这个错误。
我在上找到了img2pdf库,但是当我有PIL格式时,我不知道如何使用它(使用PIL格式时,使用class 'PIL.Image.Image' s3上传看起来也像文件一样的对象,所以我不想在加载它之前将它保存到一个临时文件中那么,在这种情况下我甚至需要img2pdf吗?编辑:我尝试使用tobytes()并直接上传到s3。上传很成功。但是,当下载以查看内容时,它会显示一个空页面。) # example action I wanna take with Pillow
data = im_resized.tobyt