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

使用scikit-image模块时遇DLL加载失败错误求助

Fixing DLL Load Error with scikit-image/Pillow on Windows 10 (Anaconda Spyder, Python 3.6.4)

Hey there, let's get this DLL load issue sorted out for you. The error trace points directly to a problem with the PIL (Pillow) library's _imaging module failing to load—this is super common with older Python versions like 3.6.4 where package compatibility can get tricky. Here are step-by-step fixes to try:

1. Reinstall a Pillow Version Compatible with Python 3.6.4

Older Python versions need matching older Pillow releases. Let's swap out your current Pillow for one that plays nice:

  • First, open your Anaconda Prompt, activate your working environment (if you're not using base), then uninstall the current Pillow:
    conda uninstall pillow -y
    
  • Install a verified compatible version (Pillow 5.4.1 works great with Python 3.6 on Windows):
    conda install pillow=5.4.1 -y
    
    If conda gives you trouble with this version, try using pip instead:
    pip install pillow==5.4.1
    

2. Ensure Your Environment Has numpy-mkl (Not Regular numpy)

You mentioned trying numpy-mkl, but let's double-check it's properly set up:

  • List your current numpy package to confirm:
    conda list numpy
    
  • If you see just numpy (not numpy-mkl), uninstall the regular version and install mkl-enabled numpy:
    conda uninstall numpy -y
    conda install numpy-mkl -y
    

3. Install the Correct Visual C++ Redistributable

Python 3.6 is compiled with Visual Studio 2015, so you need the matching redistributable package (even if you installed newer VC libraries):

  • Make sure you have the 64-bit Visual C++ Redistributable for Visual Studio 2015 installed—this is required for the DLLs used by Pillow and scikit-image to load correctly. If you previously installed newer versions (like 2017/2019), this older version is still needed alongside them.

4. Test the Fix with a Minimal Code Snippet

After making the above changes, test if PIL loads first (since that's the root issue):
Open Spyder and run this minimal code:

from PIL import Image
# Try opening your image to verify PIL works
test_img = Image.open('mire.jpg')
test_img.show()

# Now test scikit-image
from skimage import io
img = io.imread('mire.jpg', as_grey=True)
io.imshow(img)

If PIL loads and shows the image, scikit-image should work without the DLL error.

5. Create a Clean Environment (If All Else Fails)

If your current environment has conflicting packages, a fresh environment often fixes things:

  • Create a new environment with Python 3.6.4:
    conda create -n skimage_test python=3.6.4 -y
    
  • Activate it and install the required packages:
    conda activate skimage_test
    conda install scikit-image numpy-mkl pillow=5.4.1 -y
    
  • Switch Spyder to use this new environment (go to Tools > Preferences > Python interpreter and select skimage_test), then run your code again.

内容的提问来源于stack exchange,提问作者nizar aoufi

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.15 03:52:28