Neither Pillow nor PIL could be imported: No module named Image

℡╲_俬逩灬. 提交于 2019-12-25 16:22:30

问题


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?


回答1:


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




回答2:


I had the same issue with virtualenv and Django, following command fixed that:

easy_install PIL


来源:https://stackoverflow.com/questions/22752598/neither-pillow-nor-pil-could-be-imported-no-module-named-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!