AttributeError: module ‘PIL. Image’ has no attribute ‘open’. It means PIL.image does not has an open method. I have searched lots of solutions online, but they are not work. Finally, I inadvertently saw the address of image.py (c:\users\lenovo\pycharmprojects\kk\venv\lib\site packages\pil\image.py). I know the reason of the error.
from PIL import Image
import os
import csv
import time
Reason: the image.py file under the PIL package was accidentally emptied, so image.open() cannot be realized.
temp_img_now = Image.open(temp_file)
Solution: uninstall the pilot and pillow-PIL, and then reinstall them.
Read More:
- [How to Solve]AttributeError: module ‘scipy’ has no attribute ‘io’
- AttributeError: module ‘time‘ has no attribute ‘clock‘ [How to Solve]
- [Solved] AttributeError: module ‘logging‘ has no attribute ‘Handler‘
- [Solved] AttributeError: module ‘distutils‘ has no attribute ‘version‘
- AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘ [How to Solve]
- [Solved] AttributeError: module ‘setuptools._distutils‘ has no attribute ‘version‘
- [Solved]AttributeError: module ‘urllib’ has no attribute ‘quote’
- [Solved] AttributeError: partially initialized module ‘xlwings’ has no attribute ‘App’
- [Solved] AttributeError: module ‘time‘ has no attribute ‘clock‘
- Python3.7 AttributeError: module ‘time‘ has no attribute ‘clock‘
- [Solved] AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘
- [Perfectly Solved] attributeerror: module ‘SciPy. Misc’ has no attribute ‘toimage’ error
- [Solved] AttributeError: module ‘tensorflow‘ has no attribute ‘distributions‘
- [Solved] Python Error: AttributeError: partially initialized module ‘keyword‘ has no attribute ‘kwlist‘
- Python AttributeError: module ‘tensorflow‘ has no attribute ‘InteractiveSession‘
- BlazingSQL Error: AttributeError: module ‘cio‘ has no attribute ‘RunQueryError‘
- [Solved] AttributeError: module ‘dlib‘ has no attribute ‘get_face_chip‘
- [Solved] AttributeError: module ‘pandas‘ has no attribute ‘rolling_count‘
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- [How to Solve]AttributeError: module ‘scipy’ has no attribute ‘stats’