错误提示

使用 Python 编译 PIL 包时提示 ImportError: cannot import name 'image' from 'PIL' (C:\ProgramData\Anaconda3\lib\site-packages\PIL\__init__.py)

原因分析

导入 Pillow 模块错误
Python 未正确引用包

解决办法1

重新安装 Pillow 包

pip uninstall Pillow
pip install Pillow

解决办法2

Another thought - considering that the first problem means that Python wasn’t able to import the package correctly in some way, you might try python -m pip install Pillow instead of just pip install Pillow, as that will ensure that the same Python is being used for pip as for the running of your script.

python -m pip uninstall Pillow
python -m pip install Pillow

错误截图

在这里插入图片描述

References

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐