枕头不工作

Iva*_*vic 0 django python-3.x 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".
Run Code Online (Sandbox Code Playgroud)

当我运行 pip freeze 时,我可以看到 Pillow 已经安装:

Pillow==2.7.0
Run Code Online (Sandbox Code Playgroud)

我使用的是 Python 3.4.3 和 Django 1.8。我在使用 Python 2.7 时没有这个问题。

更新:

当我尝试从我的 virtualenv 之外的 PIL 导入 Image 时,一切都很好,但是当我在 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.
Run Code Online (Sandbox Code Playgroud)

我在 virtualenv 之外安装了 python2,这是否意味着 python 没有在我的 virtualenv\Lib\site-packages 中查找?我刚刚注意到,当我运行 pip freeze 时,我会得到一个安装在我的系统上而不是在 virualenv 中的软件包列表,而且当我尝试安装已经安装在我的系统上的东西时,我必须运行 pip --upgrade .

Iva*_*vic 5

我克服了这个问题,easy_install --upgrade pillow如果我想在我的系统上已经拥有的 virtualenv 中安装一些包,我可以使用pip <name of package> --upgrade. 如果有人对此问题有解释和更好的解决方案,请告诉我!