【问题标题】:UnsupportedOperation: fileno不支持的操作:fileno
【发布时间】:2016-03-15 18:11:22
【问题描述】:

我在尝试上传文件时收到以下错误消息:

  File "/home/ymorin007/.virtualenvs/dvotedfan/lib/python2.7/site-packages/django_resized/forms.py", line 47, in save
    thumb.save(new_content, format=img.format, quality=self.field.quality, **img.info)
  File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 1439, in save
    save_handler(self, fp, filename)
  File "/usr/local/lib/python2.7/site-packages/PIL/JpegImagePlugin.py", line 471, in _save
    ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
  File "/usr/local/lib/python2.7/site-packages/PIL/ImageFile.py", line 476, in _save
    fh = fp.fileno()
UnsupportedOperation: fileno

我已经安装了 Pillow 3.1。和 django 调整大小。在本地完美运行,但在我的外部服务器上没有。

【问题讨论】:

    标签: django python-imaging-library


    【解决方案1】:

    我已经移除了 Pillow,现在它可以工作了。

    【讨论】:

    • 我在移除 Pillow 时收到 ModuleNotFoundError: No module named 'PIL' 错误。
    猜你喜欢
    • 2017-11-09
    • 1970-01-01
    • 2015-11-27
    • 1970-01-01
    • 1970-01-01
    • 2022-08-15
    • 2023-03-24
    • 2016-08-10
    • 1970-01-01
    相关资源
    最近更新 更多