我参加了一个项目,所以我想建立一个环境,所以我所做的是:
pip install -r requirements.txt这完全安装了所有需求,包括django 1.7.0、Pillow 2.4.0和其他一些需求。
然后我要构建数据库:
python manage.py migrate砰,错误,我得到了以下信息:
CommandError: System check identified some issues:
ERRORS:
stu.chan.icon: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.python.org/pypi/Pillow or run command "pip install pillow".
stu.chan.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.python.org/pypi/Pillow or run command "pip install pillow".
stu.Piec.icon: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.python.org/pypi/Pillow or run command "pip install pillow"...。好像我没有安装枕头。因此,我检查了已安装的包(使用这技术),并安装了Pillow 2.4.0。
然后,我还试图强制重新安装:pip install --upgrade --force-reinstall Pillow==2.4.0
但是,在运行migrate时,我没有得到相同的错误。
我在MacOSX10.6.7的MacOSX10.6.7上使用了python 3.4.0和django 1.7.0,pip降级为pip 1.2.1 (因为有一些带有pip和ssl的virtualenv 1.11.6 问题 )。
上面所有的代码都在virtualenv (bin/activate完成)中。
你对为什么这个问题和如何解决这个问题有什么想法吗?
当我运行上面的force-reinstall命令时(太多的代码被抛出,除了粘贴之外,我无法粘贴它),尽管它以“成功安装枕头”结束,但是代码中有一些警告:
building 'PIL._imaging' extension
(blabla code)
_imaging.c:975:13: warning: array index of '1' indexes past the end of an array (that contains 1 elements) [-Warray-bounds]
value = PyTuple_GET_ITEM(xy, 1);
^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/python3.4m/tupleobject.h:58:34: note: instantiated from:
#define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])
^
/usr/local/include/python3.4m/tupleobject.h:27:5: note: array 'ob_item' declared here
PyObject *ob_item[1];
^
1 warning generated.
(blabla code)
libImaging/Unpack.c:867:1: warning: unused function 'copy3' [-Wunused-function]
copy3(UINT8* out, const UINT8* in, int pixels)
^
1 warning generated.发布于 2020-04-11 02:35:30
我不知道为什么,但卸载和重新安装枕头(相同版本的)为我解决了这个问题。
python -m pip uninstall Pillow
python -m pip install Pillow枕头版为7.1.1。
https://stackoverflow.com/questions/25662073
复制相似问题