1
votes

my code is here to import image in py 2.7

from PIL import Image
fimg=Image.open('C:/Users/Haseeb/esktop/Images/billa_jpg_000.jpg')

But i am getting this of error.

Traceback (most recent call last):
  File "c:\Python27\Python for Begginers\newcode.py", line 1, in <module>
    from PIL import Image
  File "C:\Python27\lib\site-packages\PIL\Image.py", line 115, in <module>
    import numbers
  File "c:\Python27\Python for Begginers\numbers.py", line 1, in <module>
    from PIL import image
ImportError: cannot import name image
1

1 Answers

-1
votes

Pillow is trying to import the "numbers" module.

https://github.com/python-pillow/Pillow/blob/master/PIL/Image.py#L116

https://docs.python.org/2/library/numbers.html

But you have a file called numbers.py which it is trying to open instead. If you rename it, it should work.