Python 通过枕头库导入图像时出错

Python 通过枕头库导入图像时出错,python,image,import,python-imaging-library,Python,Image,Import,Python Imaging Library,我的代码在这里导入py 2.7中的图像 from PIL import Image fimg=Image.open('C:/Users/Haseeb/esktop/Images/billa_jpg_000.jpg') 但是我得到了这个错误 Traceback (most recent call last): File "c:\Python27\Python for Begginers\newcode.py", line 1, in <module>

我的代码在这里导入py 2.7中的图像

from PIL import Image
fimg=Image.open('C:/Users/Haseeb/esktop/Images/billa_jpg_000.jpg')
但是我得到了这个错误

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
回溯(最近一次呼叫最后一次):
文件“c:\Python27\Python for Begginers\newcode.py”,第1行,在
从PIL导入图像
文件“C:\Python27\lib\site packages\PIL\Image.py”,第115行,在
进口编号
文件“c:\Python27\Python for Begginers\numbers.py”,第1行,在
从PIL导入图像
导入错误:无法导入名称图像

枕头正在尝试导入“数字”模块


但是您有一个名为numbers.py的文件,它正在尝试打开该文件。如果您重命名它,它应该可以工作

看起来你的图像路径也有输入错误,esktop不是桌面。亲爱的Hugo,我试图重命名它,但仍然无法导入图像,因为出现以下错误。从PIL import image PIL_im=image.open('C:\Users\Haseeb\Desktop\Images\lingo.jpg')中,错误不会显示在您的注释中。请编辑您的问题并将其添加到那里。