No module named Image

前端 未结 5 1435
心在旅途
心在旅途 2020-12-13 19:10

Sorry for my grammar, I don\'t speak English. After I set filebrowser, tinymce, and grappelli, I get this error: No module named Image

try:
             


        
相关标签:
5条回答
  • 2020-12-13 19:25

    You can this query:

    pip install image 
    

    I had pillow installed, and still, I got the error that you mentioned. But after I executed the above command, the error vanished. And My program worked perfectly.

    0 讨论(0)
  • 2020-12-13 19:33

    It is changed to : from PIL.Image import core as image for new versions.

    0 讨论(0)
  • 2020-12-13 19:34

    Did you setup PIL module? Link

    You can try to reinstall it on your computer.

    0 讨论(0)
  • 2020-12-13 19:46

    You are missing PIL (Python Image Library and Imaging package). To install PIL I used

     pip install pillow
    

    For my machine running Mac OSX 10.6.8, I downloaded Imaging package and installed it from source. http://effbot.org/downloads/Imaging-1.1.6.tar.gz and cd into Download directory. Then run these:

        $ gunzip Imaging-1.1.6.tar.gz
        $ tar xvf Imaging-1.1.6.tar
        $ cd Imaging-1.1.6
        $ python setup.py install
    

    Or if you have PIP installed in your Mac

     pip install http://effbot.org/downloads/Imaging-1.1.6.tar.gz
    

    then you can use:

    from PIL import Image
    

    in your python code.

    0 讨论(0)
  • 2020-12-13 19:46

    Problem:

    ~$ simple-image-reducer
    
    Traceback (most recent call last):
    
      File "/usr/bin/simple-image-reducer", line 28, in <module>
        import Image
    
    **ImportError: No module named Image**
    

    Reason:

    Image != image

    Solution:

    1) make sure it is available

    python -m pip install  Image
    

    2) where is it available?

    sudo find ~ -name image -type d
    

    -->> directory /home/MyHomeDir/.local/lib/python2.7/site-packages/image ->> OK

    3) make simple-image-reducer understand via link:

    ln -s ~/.local/lib/python2.7/site-packages/image
    ~/.local/lib/python2.7/site-packages/Image
    

    4) invoke simple-image-reducer again. Works:-)

    0 讨论(0)
提交回复
热议问题