已安装枕头,但收到ModuleNotFoundError:没有名为

时间:2020-04-02 04:26:50

标签: python python-3.x pycharm

我刚开始学习python(大约12个小时前),我希望能够显示图像,所以我在线搜索了,Pillow可以打开图像本身。 因此,我安装了点子,并用点子安装了枕头。然后我创建了一个名为
的python文件 image importing test.py我将文件放在一个名为“ image1.jpg”的文件夹中 我用PyCharm打开image importing test.py,并尝试了以下代码:

from PIL import Image

image1 = Image.open('image1.jpg')
image1.show() 

并且根据我在网上观看的教程,这本来可以用,但是我却得到了

Traceback (most recent call last):
  File " *path to my image importing test.py file that I don't wish to share unless absolutely necessary* ", line 1, in <module>
    from PIL import Image
ModuleNotFoundError: No module named 'PIL'

您能解释一下原因以及如何解决此错误吗? 我使用Windows 10计算机,PyCharm,Python 3.8.2(如果有帮助)。

0 个答案:

没有答案
相关问题