我使用以下所有注释正确安装了枕头: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版本的,但是我安装了pip 对于win64
请帮助,谢谢
答案 0 :(得分:1)
假设您使用以下命令致电manage.py:
python manage.py runserver
python3.7 manage.py runserver
或类似的方法尝试使用安装枕头
python -m pip install pillow==6.2.0
这会将其安装到目标版本中,请确保将python
替换为用于运行manage.py的任何命令,例如python3.8
或类似命令。
希望这会有所帮助!