【问题标题】:Neither Pillow nor PIL could be imported: No module named ImagePillow 和 PIL 都无法导入:没有名为 Image 的模块
【发布时间】:2023-03-18 02:52:01
【问题描述】:

我正在尝试在我的 django 应用程序中使用 PIL/Pillow,在 virtualenv 中运行,最终部署到 Heroku。

我已经完成的步骤:

  • 已启动 virtualenv(源 venv/bin/activate)
  • 点安装枕头

输出:

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-    error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1

否则,有很多复制的文件: 例如copying PIL/__init__.py -> build/lib.macosx-10.9-intel-2.7/PIL

但是,运行 python manage.py runserver 失败并在标题中显示错误消息。试过 pip install pil 还是不行。关于如何修复的任何提示?

【问题讨论】:

    标签: django heroku python-imaging-library pillow


    【解决方案1】:

    更新:哦找到答案了

    ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pillow
    

    未使用的参数阻止了枕头的进一步安装。以上告诉它不要将未使用的参数视为错误。

    发现于(阅读更多):Can't install mysql gem on OS X

    【讨论】:

      【解决方案2】:

      我在使用 virtualenv 和 Django 时遇到了同样的问题,以下命令解决了这个问题:

      easy_install PIL
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-11-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-09-17
        • 2021-06-25
        相关资源
        最近更新 更多