简体   繁体   中英

PIL installation on anaconda for windows 10, 64 bit

when I ran conda-forge to get xgboost running, it seems to have affected few running packages, one of them being PIL. It was running properly until I ran conda-forge, but now I am getting the following error.


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.

when I try to install PIL again using conda install pil, I get the following error message


(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.

I then installed pillow, which seems to have gone well. But when I run from PIL import image, I still get the same error as above. I tried from pillow import image, it says no module found named pillow

Any advice on how to resolve this issue and get PIL working again?

I am using anaconda3 on windows 10, 64bit.

The problem looks like you have both pythons 2.x versions and a 3.x version. try the following

  1. create a conda environment with python 3.6

     conda create -n pil-env python=3.6 
  2. load PIL

    conda install Pillow==4.0.0

I found Pillow 4.0.0 to be the most stable while using it on 3.6

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM