简体   繁体   English

Heroku PIL ModuleNotFoundError:没有名为“图像”的模块

[英]Heroku PIL ModuleNotFoundError: No module named 'Image'

I am creating a Heroku app in which I am using PIL and from PIL import Image .我正在创建一个 Heroku 应用程序,我在其中使用PIL和 from PIL import Image

When I run heroku local , it returns ModuleNotFoundError: No module named 'Image' .当我运行heroku local时,它返回ModuleNotFoundError: No module named 'Image' I have tried using Pillow instead of PIL, but it returns the same error.我曾尝试使用 Pillow 而不是 PIL,但它返回相同的错误。 PIL and Pillow are both in my requirements.txt. PIL 和 Pillow 都在我的 requirements.txt 中。

A link to my full github repo is: https://github.com/maivey/flower-image-classifier我完整的 github 存储库的链接是: https://github.com/maivey/flower-image-classifier

Please help as I do not understand why it will not recognize PIL or Pillow请帮忙,因为我不明白为什么它不能识别 PIL 或 Pillow

Maybe you need to install them.也许你需要安装它们。 If you use anaconda: conda install PIL If you use pip: pip install PIL如果您使用 anaconda:conda conda install PIL如果您使用 pip: pip install PIL

Thanks谢谢

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM