django - Pillow 安装正确,但 Image Field 出错 Pillow is not installed - Django
问题描述
我使用所有这些评论正确安装枕头:Pip install Pillow - Pip Insall Pillow==6.2.0 -
pip install Pillow
Requirement already satisfied: Pillow in c:\program files (x86)\python38-32\lib\site-packages (7.2.0)
python -m pip install --upgrade 枕头
python -m pip install --upgrade Pillow
Requirement already up-to-date: Pillow in c:\program files (x86)\python38-32\lib\site-packages (7.2.0)
并将 Pip 更新为成功,但是当我想像这样添加 ImageField 时image = models.ImageField()
,我遇到了这个错误:
eCommerce.Item.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.org/project/Pillow/ or run the command "pip install Pillow".
有人说这是你的 windows 版本,但我为 win64 安装 pip
请帮忙,谢谢
解决方案
假设您使用以下方法调用 manage.py:
python manage.py runserver
python3.7 manage.py runserver
或类似的尝试安装枕头使用
python -m pip install pillow==6.2.0
这会将其安装到目标版本中,请确保替换python
为您用于运行 manage.py 的任何命令,例如python3.8
或类似命令。
希望这会有所帮助!
推荐阅读
- javascript - 如何通过jquery函数将值传递给输入元素
- scala - 从Greenplum上的表中读取数据时,如何在Spark-jdbc应用程序的选项“dbtable”中指定子查询?
- java - 为什么多线程在java中写入文件时速度较慢
- python - /pro/bill/8/pdf/ 'decimal.Decimal' 对象的 AttributeError 没有属性 'get'
- python - QTextEdit 并将图像保存到 .html
- python - 变量未定义和缩进错误
- android - 使用 Google 登录用户 ID 来唯一标识此连接用户存储在 Firestore 中的条目是否是个好主意?
- javascript - 如何通过 Javascript 函数调用 PHP 函数来更新 mysql 表中的数据?
- excel - 如何创建一个扫描excel文档并将数据项存储在数据库中的系统?
- javascript - 光标位于右侧而不是左侧