You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows环境下Python 3.7.0a2安装Pillow失败求助

Fixing Pillow Installation Issues on Windows 10 (Python 3.7 + Django 2.0.2)

Hey there, I’ve run into this exact problem before on Windows with Python 3.7—installing Pillow via pip fails because it needs system-level build tools that aren’t included by default. Let’s walk through the easiest fixes to get you back to migrating your Django project:

1. Use a Pre-compiled Pillow Wheel (Quickest Fix)

Instead of letting pip try to build Pillow from source (which is causing that traceback), grab a pre-built wheel file tailored to your setup:

  • First, check if your Python is 32-bit or 64-bit: open Command Prompt and run python -c "import sys; print(sys.maxsize > 2**32)"—if it returns True, you’re on 64-bit; False means 32-bit.
  • Find a Pillow wheel that matches Python 3.7 and your system architecture. Look for filenames like Pillow-8.4.0-cp37-cp37m-win_amd64.whl (64-bit) or Pillow-8.4.0-cp37-cp37m-win32.whl (32-bit).
  • Download that wheel file to a folder you can easily access.
  • Navigate to that folder in Command Prompt, then run:
    pip install [name-of-your-downloaded-wheel-file].whl
    
    For example: pip install Pillow-8.4.0-cp37-cp37m-win_amd64.whl

2. Install Required Build Tools (If You Want to Compile Locally)

If you’d rather build Pillow from source, you need to install Microsoft’s C++ build tools:

  • Install the Microsoft Visual C++ Build Tools 2017 (make sure to check the "Desktop development with C++" workload when setting it up—this includes the compilers pip needs).
  • Restart your Command Prompt after installation, then run pip install Pillow again. This time, pip should have all the tools it needs to compile Pillow successfully.

3. Confirm It Worked & Run Migrations

Once Pillow is installed, verify it’s working by running:

python -c "import PIL; print(PIL.__version__)"

If you see a version number (like 8.4.0) without errors, head back to your Django project folder and re-run the migrations:

python manage.py migrate

That should resolve the fields.E210 error you got earlier.

Why This Happens

Python 3.7 on Windows doesn’t come with the C++ compilers required to build Pillow from source. Pre-built wheels skip the compilation step entirely, while installing the build tools gives pip the necessary environment to compile the package locally.


内容的提问来源于stack exchange,提问作者Vīkãs Vískíñg

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 06:30:40