在anaconda上安装PIL for windows 10,64 bit

时间:2017-12-01 11:14:30

标签: python

当我运行conda-forge让xgboost运行时,它似乎影响了很少的运行包,其中一个是PIL。它运行正常,直到我运行conda-forge,但现在我收到以下错误。

ImportError                               Traceback (most recent call last)
<ipython-input-3-588a23339ee5> in <module>()
      5 import matplotlib.pyplot as plt
      6 import scipy
----> 7 from PIL import Image
      8 #from pillow import Image
      9 from scipy import ndimage

C:\Anaconda3\lib\site-packages\PIL\Image.py in <module>()
     54     # Also note that Image.core is not a publicly documented interface,
     55     # and should be considered private and subject to change.
---> 56     from . import _imaging as core
     57     if PILLOW_VERSION != getattr(core, 'PILLOW_VERSION', None):
     58         raise ImportError("The _imaging extension was built for another "

ImportError: DLL load failed: The specified module could not be found.

当我尝试使用conda install pil再次安装PIL时,收到以下错误消息

(C:\Anaconda3) C:\Users\P Srinivasa Rao>conda install pil
Fetching package metadata ...............
Solving package specifications: .

UnsatisfiableError: The following specifications were found to be in conflict:
  - pil -> python 2.6*
  - python 3.6*
Use "conda info <package>" to see the dependencies for each package.
然后我安装了枕头,这似乎进展顺利。但是当我从PIL导入图像运行时,我仍然得到与上面相同的错误。我尝试从枕头导入图像,它说没有找到名为枕头的模块

有关如何解决此问题并让PIL再次运行的任何建议吗?

我在Windows 10,64位上使用anaconda3。

1 个答案:

答案 0 :(得分:0)

问题看起来你有两个pythons 2.x版本和一个3.x版本。尝试以下

  1. 使用python 3.6

    创建一个conda环境
    conda create -n pil-env python=3.6
    
  2. 加载PIL

      

    conda install Pillow == 4.0.0

  3. 我发现Pillow 4.0.0在3.6上使用时最稳定