ImportError: cannot import name ‘image‘ from ‘PIL‘ (C:\ProgramData\Anaconda3\lib\site-packages\PIL\_
生活随笔
收集整理的這篇文章主要介紹了
ImportError: cannot import name ‘image‘ from ‘PIL‘ (C:\ProgramData\Anaconda3\lib\site-packages\PIL\_
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
錯誤提示
使用 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
- ImportError: cannot import name ‘PILLOW_VERSION’ from ‘PIL’ (unknown location) #4130
總結
以上是生活随笔為你收集整理的ImportError: cannot import name ‘image‘ from ‘PIL‘ (C:\ProgramData\Anaconda3\lib\site-packages\PIL\_的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PyTorch 可视化工具 Tensor
- 下一篇: wsl 使用教程