简体   繁体   English

获取错误:ModuleNotFoundError:没有名为“PIL”的模块

[英]Getting Error: ModuleNotFoundError: No module named 'PIL'

I know that question has asked over and over.我知道这个问题已经问过一遍又一遍。 I'm struggling through ages in order to solve it.为了解决这个问题,我一直在苦苦挣扎。

Issue is: I have done pip3 install Pillow and every kind of combinations with upper or lower case.问题是:我已经完成了pip3 install Pillow以及各种大写或小写的组合。 (Windows 10) I find the package at site-packages which says 'PIL' but every time when i execute the code from PIL import Image it is not working and giving me ModuleNotFoundError. (Windows 10)我在 site-packages 上找到了一个包,上面写着“PIL”,但是每次当我from PIL import Image执行代码时from PIL import Image它都不起作用并给我 ModuleNotFoundError。 I'm about to lose my mind can anyone help me out for this ?我快要疯了,有人可以帮我解决这个问题吗?

Please try below if it solves your issue:如果它解决了您的问题,请尝试以下操作:

  1. Try to list the packages using command py -m pip list .For more detail check https://pip.pypa.io/en/stable/cli/pip_list/ If the package is not listed it means it is not installed.尝试使用命令py -m pip list 。有关更多详细信息,请检查https://pip.pypa.io/en/stable/cli/pip_list/如果未列出包,则表示未安装。
  2. If you are using virtual env.如果您使用的是虚拟环境。 First check if the virtual env is activated then list packages using same py -m pip list .首先检查虚拟环境是否已激活,然后使用相同的py -m pip list列出包。
  3. Also as per Pillow docs https://pillow.readthedocs.io/en/stable/installation.html : "Pillow and PIL cannot co-exist in the same environment. Before installing Pillow, please uninstall PIL".同样根据 Pillow 文档https://pillow.readthedocs.io/en/stable/installation.html :“Pillow 和 PIL 不能在同一环境中共存。在安装 Pillow 之前,请先卸载 PIL”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我收到错误:ModuleNotFoundError: No module named 'PIL' - I am getting the error : ModuleNotFoundError: No module named 'PIL' ModuleNotFoundError:没有名为“PIL”的模块,ImageTk - ModuleNotFoundError: No module named 'PIL', ImageTk Django ModuleNotFoundError:没有名为“PIL”的模块 - Django ModuleNotFoundError: No module named 'PIL' 无法导入 PIL ModuleNotFoundError: No module named 'PIL' - can not import PIL ModuleNotFoundError: No module named 'PIL' 获取错误 ModuleNotFoundError at / No module named 'sekizai' - Getting the error ModuleNotFoundError at / No module named 'sekizai' 我一直收到“ModuleNotFoundError:没有名为‘error’的模块” - I kept getting "ModuleNotFoundError: No module named 'error'" 出现错误 - ModuleNotFoundError: No module named 'xlsxwriter' with ExcelWriter - Getting error of - ModuleNotFoundError: No module named 'xlsxwriter' with ExcelWriter Heroku PIL ModuleNotFoundError:没有名为“图像”的模块 - Heroku PIL ModuleNotFoundError: No module named 'Image' 在IBM Cloud Functions中的virtualenv中使用PIL时出错:ModuleNotFoundError:没有名为“ PIL”的模块 - Error using PIL in a virtualenv in IBM Cloud Functions: ModuleNotFoundError: No module named 'PIL' Python 3.8 ModuleNotFoundError:没有名为“PIL”的模块 - Python 3.8 ModuleNotFoundError: No module named 'PIL'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM