Pillow和PIL都不能导入:没有名为Image的模块 [英] Neither Pillow nor PIL could be imported: No module named Image

查看:1032
本文介绍了Pillow和PIL都不能导入:没有名为Image的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



已完成的步骤:




  • 启动virtualenv(源venv / bin /激活)

  • pip安装枕头



输出:

  clang:error:unknown参数:'-mno-fused-madd'[-Wunused-command-line-argument-hard-error-in-future] 
clang:注意:这将是一个困难的错误(不能降级为警告)在未来
错误:命令'cc'失败与退出状态1
/ pre>

否则,有很多复制的文件:
eg 复制PIL / __ init__.py - > build / lib.macosx-10.9-intel-2.7 / PIL



但是,运行python manage.py runserver失败,并显示错误消息标题。尝试点安装pil,不工作。任何关于如何解决的问题?

解决方案

更新:哦找到答案

  ARCHFLAGS = -Wno-error = unused-command-line-argument-hard-error-in-future pip安装枕头
pre>

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



找到(阅读更多):无法在OS X上安装mysql gem


I am trying to use PIL/Pillow in my django app, running in virtualenv, for eventual deployment to Heroku.

Steps I have done:

  • started virtualenv (source venv/bin/activate)
  • pip install pillow

Output:

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

otherwise, there were a lot of copied files: e.g. copying PIL/__init__.py -> build/lib.macosx-10.9-intel-2.7/PIL

However, running python manage.py runserver fails with the error message in the title. Tried pip install pil and does not work. Any inkling on how to fix?

解决方案

UPDATE: oh found the answer

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

the unused arguments was preventing further install of pillow. the above tells it to not treat the unused argument as an error.

Found at (To Read more): Can't install mysql gem on OS X

这篇关于Pillow和PIL都不能导入:没有名为Image的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆