枕头坏了
Pillow is not working
我刚开始一个新的 Django 项目,当我尝试 makemigratons 时,我收到一条错误消息,提示我必须安装 Pillow,而我已经安装了 Pillow。
ERRORS:
shop.ProductImages.product_img: (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".
当我 运行 pip freeze 时,我可以看到 Pillow 已经安装:
Pillow==2.7.0
我正在使用 Python 3.4.3 和 Django 1.8。
我在用Python 2.7.
的时候没有这个问题
更新:
当我尝试从我的 virtualenv 之外的 PIL 导入图像时,一切都很好,但是当我在 virtualenv 中尝试时,我得到这个:
Traceback (most recent call last):
Fille "<stdin>", line 1, in <module>
File "C:\Python27\Lib\site-packages\PIL\Image.py", line 63, in <module>
from PIL import _imaging as core
ImportError: DLL load failed: The specified module could not be found.
我在我的 virtualenv 之外安装了 python2 那么这是否意味着 python 没有在我的 virtualenv\Lib\site-packages 中查找?
我刚刚注意到,当我 运行 pip freeze 时,我得到了一个安装在我的系统上而不是在 virualenv 中的软件包列表,当我尝试安装已经安装在我的系统上的东西时,我必须 运行 pip --upgrade.
我用 easy_install --upgrade pillow
克服了这个问题,如果我想在 virtualenv 中安装一些我系统上已有的包,我可以使用 pip <name of package> --upgrade
。
如果有人对此问题有解释和更好的解决方案,请告诉我!
发生这种情况是因为您安装了多个 python 版本。卸载其他 python 版本并在最新的 python 版本上安装 pillow。
我刚开始一个新的 Django 项目,当我尝试 makemigratons 时,我收到一条错误消息,提示我必须安装 Pillow,而我已经安装了 Pillow。
ERRORS:
shop.ProductImages.product_img: (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".
当我 运行 pip freeze 时,我可以看到 Pillow 已经安装:
Pillow==2.7.0
我正在使用 Python 3.4.3 和 Django 1.8。 我在用Python 2.7.
的时候没有这个问题更新:
当我尝试从我的 virtualenv 之外的 PIL 导入图像时,一切都很好,但是当我在 virtualenv 中尝试时,我得到这个:
Traceback (most recent call last):
Fille "<stdin>", line 1, in <module>
File "C:\Python27\Lib\site-packages\PIL\Image.py", line 63, in <module>
from PIL import _imaging as core
ImportError: DLL load failed: The specified module could not be found.
我在我的 virtualenv 之外安装了 python2 那么这是否意味着 python 没有在我的 virtualenv\Lib\site-packages 中查找? 我刚刚注意到,当我 运行 pip freeze 时,我得到了一个安装在我的系统上而不是在 virualenv 中的软件包列表,当我尝试安装已经安装在我的系统上的东西时,我必须 运行 pip --upgrade.
我用 easy_install --upgrade pillow
克服了这个问题,如果我想在 virtualenv 中安装一些我系统上已有的包,我可以使用 pip <name of package> --upgrade
。
如果有人对此问题有解释和更好的解决方案,请告诉我!
发生这种情况是因为您安装了多个 python 版本。卸载其他 python 版本并在最新的 python 版本上安装 pillow。